Splunk Search

How do I join an inputlookup and a tstats search?

PotatoDataUser
Explorer

So I have a lookup file with a complete list of servers and their details like version, owner etc, and an index my_index that gets logs from servers.

This is the search I am using right now

| inputlookup my_lookup.csv
| join type=left server_name
   [ | tstats count where index=my_index by host
      | eval reporting="yes"]

| eval reporting=if(isnull(reporting),"No","Yes")


I want to validate the list by referencing it against the tstats reports and show the whole list of the lookupfile.

What I want to know is if this search is accurate, will the subsearch truncate results giving me inaccurate output, is there any alternate way to write this search, Please help.

Labels (3)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust
| tstats ...
| inputlookup append=t ...
| stats values(*) as * by host

 

View solution in original post

PickleRick
SplunkTrust
SplunkTrust
| tstats ...
| inputlookup append=t ...
| stats values(*) as * by host

 

gcusello
SplunkTrust
SplunkTrust

Hi @PotatoDataUser ,

try using the lookup command (https://docs.splunk.com/Documentation/Splunk/9.3.1/SearchReference/Lookup)

| tstats count where index=my_index by host
| lookup my_lookup.csv server_name

Ciao.

Giuseppe

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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...