Splunk Search

Search returning too much

a212830
Champion

Hi,

I want to query on eventtype, and my query is returning items that I don't want. My search is:

source="/var/opt/trapx/log/traps-all.log" tag::eventtype="SNMP" | fields eventtype, host |chart count by eventtype, host

The search is returning eventypes that aren't tagged with SNMP. I also tried running it with a match on eventtype directly (eventtype="*_Trap"), and it did the same thing. Any suggestions?

Tags (3)
0 Karma

roumys
Explorer

Verify what you search you had when you created your eventtype=SNMP
Should look similar to this:
source="/var/opt/trapx/log/traps-all.log" SNMP

(you don't even need to add SNMP as based on your log name it seems like everything inside should just be snmptrap logs)

save event as SNMP

and then use the query
source="/var/opt/trapx/log/traps-all.log" eventtype=SNMP | chart count by eventtype, host

(you don't need to add fields as when you chart it you are choosing the fields already.)

0 Karma

roumys
Explorer

source="/var/opt/trapx/log/traps-all.log"| eval a=mvfilter(eventtype == SNMP) | search a=* | chart count by a, host

0 Karma

a212830
Champion

OK. Did that, and it returns other eventtypes as well, which I didn't create (possibly system eventtypes?). It also returns "nix-all-logs" eventtypes.

0 Karma
Get Updates on the Splunk Community!

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...