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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...