Splunk Search

multisearch with a lookup and index?

msage
Path Finder

I'm looking to combine data from a lookup file to data from our security server to create a comparison chart between how many alarms we get (security server) and how many of those are acknowledged (lookup file). I figured multisearch was the way to go but I'm getting errors when using it. The search is below. The reason for the eval Date fields are because one column contains dates so I needed to get them in the right order since they were always out. The end goal is a daily chart showing x alarms and y acknowledgements. 

 

| multisearch

    [| inputlookup genericlookupname.csv
| eval Date=strptime(Date,"%m/%d/%Y")
| sort Date
| eval Date=strftime(Date,"%m/%d/%Y")]
    [search index=index EVDESCR="alarm"]

 

 

Labels (2)
0 Karma

manjunathmeti
Champion

hi @msage,

Try this:

index=<provide_index_name> EVDESCR="alarm" 
| append [ | inputlookup genericlookupname.csv ]
| eval Date=coalesce(Date, strftime(_time, "%m/%d/%Y"))
| stats count(eval(index="<provide_index_name>")) as alarms, count(eval(index!="<provide_index_name>")) as acknowledgements by Date
0 Karma

msage
Path Finder

Hey @manjunathmeti ,

 

I tried this but unfortunately the lookup data always stays at 0. 

0 Karma

manjunathmeti
Champion

Does genericlookupname.csv has Date field?

Tags (1)
0 Karma

msage
Path Finder

It does yes

0 Karma

manjunathmeti
Champion

Try this:

index=<provide_index_name> EVDESCR="alarm" 
| append [ | inputlookup genericlookupname.csv | eval index="mycsvdata" ]
| eval Date=coalesce(Date, strftime(_time, "%m/%d/%Y"))
| fields index, Date
| stats count(eval(index="<provide_index_name>")) as alarms, count(eval(index="mycsvdata")) as acknowledgements by Date

 

If this reply helps you, a like would be appreciated.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...