Splunk Search

using mvfind for an eventtype

ytl
Path Finder

i have numerous eventtypes defined and in many cases a logging event may have several eventtypes associated with it.

i would like to be able to plot the eventtypes such that i do not get duplicates in the chart/pie chart. for example, i may have a log entry with eventtype=cisco_syslog_types and eventtype=network_port (ie it's a multivariable field)

i understand that there is a 'mvfind()' command where i could potentially do something like

search X | eval mvfind( eventtype, "network_*" )

but it returns that the 'mvfind' function is unsupported. i'm using splunk 4.2.1.

i've also tried using the mvindex() command with success, however, as the order of the eventtype mv is never the same, its usefulness is somewhat limited.

1 Solution

mw
Splunk Employee
Splunk Employee

I'm not sure what the deal is with mvfind, but would this work?:

search X | eval a=mvfilter(eventtype LIKE "network_%") | search a=* | timechart count by a

View solution in original post

brettcave
Builder
0 Karma

mw
Splunk Employee
Splunk Employee

I'm not sure what the deal is with mvfind, but would this work?:

search X | eval a=mvfilter(eventtype LIKE "network_%") | search a=* | timechart count by a

mw
Splunk Employee
Splunk Employee

To be clear, you can use mvfilter(match(...)) and mvfilter(NOT match(...)), mvfilter(like(...)), etc

0 Karma

mw
Splunk Employee
Splunk Employee

Strangely, I don't think you can literally do: mvfilter(eventtype NOT LIKE ".."). I believe you have to switch syntax. Something like (this uses regular expressions, rather than %): eval a=mvfilter(NOT match(eventtype, "\..*$")) | search a=*

0 Karma

ytl
Path Finder

cool; that worked! 🙂 is there a way to do a 'NOT' in the like? specifically, i have single events with both eventtypes network_acl and network_acl.deny and i only care to count the ones without the '.' in the eventtype. cheers!

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

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 ...