Splunk Search

How to pass calculate the latest row count in multiple lookups?

rajeshmetso
Engager

Hi All,

 

I have around 100+ lookups, which get updated daily from indexed data using macro and saved search. I want to find if any of these lookups are getting flushed and row count turns to "0".  I created a lookup with all the lookup names and tried to pass the output to another lookup command and pull the stats. But this is not working. 

Any suggestion to fullfil this requirement would be appreciated

Thanks

Rajesh

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

It can get a bit complicated, but you could try something like this (assuming you have a lookup file with the names of the lookups in a field called file):

| inputlookup lookups.csv
| map search="| inputlookup "$file$"| stats count|eval file=\""$file$"\""

 However, this can sometimes fail if you don't have a definition for the lookup, in which case, try it this way

| inputlookup lookups.csv
| map search="| makeresults | map search=\"| inputlookup "$file$"| stats count\"|eval file=\""$file$"\""

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It can get a bit complicated, but you could try something like this (assuming you have a lookup file with the names of the lookups in a field called file):

| inputlookup lookups.csv
| map search="| inputlookup "$file$"| stats count|eval file=\""$file$"\""

 However, this can sometimes fail if you don't have a definition for the lookup, in which case, try it this way

| inputlookup lookups.csv
| map search="| makeresults | map search=\"| inputlookup "$file$"| stats count\"|eval file=\""$file$"\""
0 Karma

rajeshmetso
Engager

@ITWhisperer 

Thank you for quick response. This sorted the issue, but am getting only 10 results and below warning.

The search result count (110) exceeds maximum (10), using max. To override it, set maxsearches appropriately.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
0 Karma

rajeshmetso
Engager

@ITWhisperer thank you it worked.

| inputlookup lookups.csv | map search="| makeresults | map search=\"| inputlookup "$file$"| stats count\"|eval file=\""$file$"\"" maxsearches=150

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...