Splunk Search

What are the differences between the lookup and inputlookup commands?

sel105
New Member

Is there any reason why this command would work:

| inputlookup myfile | search SERIAL_NO "1234" | table X, Y, Z

And this command would work:

index=mydata serial_number="1234" | table subject

But this command would not work:

index=mydata serial_number="1234" | lookup myfile SERIAL_NO as serial_number output X, Y, Z | table subject, X, Y, Z

And by "not work", I mean that the table command produces a result with "subject," but no X, Y, or Z..... the lookup is failing.

0 Karma

jplumsdaine22
Influencer

Does this command work? | inputlookup myfile | search SERIAL_NO="1234" | table X, Y, Z (note the = between SERIAL_NO and 1234) it may be that the fields are not correctly configured, thus lookup myfile SERIAL_NO as serial_number output X, Y, Z returns no values.

The inputlookup command you use may be matching the string "1234" rather than the field SERIAL_NO, which is why it works.

0 Karma

sel105
New Member

Thanks! But yes, that command works. WE think we've figured out the problem which is that the file reached over 10MB in size, so splunk indexed/cached it. then, when we uploaded a new file (one that has 1234 in it), splunk is still using the old cached version. does anyone know where i can delete the tsidx file of the cached version?

0 Karma

jplumsdaine22
Influencer

I don't know sorry. Hopefully someone else can help.

0 Karma

sel105
New Member

also probably worth noting that for, let's say, serial number 3333....which was in one of the previous versions of this lookup file, and is also in the newer version...... this command works fine. is the lookup file cached somewhere that only gets looked at when "|lookup" is run, but not when "|inputlookup" is run?

0 Karma

sel105
New Member

It might be important to note that this lookup file is one that we have to delete and replace monthly. we can't append because the data changes so much every month.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Unlocking Unified Insights: New Gigamon Federated Search App for Splunk

In today’s data-heavy environment, organizations are caught in a data distribution dilemma. As data volumes ...

GA: New Data Management App in Splunk Platform

Streamlining Data Management: Introducing a unified experience in Splunk Managing data at scale shouldn’t feel ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...