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!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...