Splunk Search

Need help understanding Appending to Lookup file

neerajs_81
Builder

Hi All,
I have the below search.  I am being told it appends results to a lookup table called user_ids.   

 

index=ad earliest=-15d
|stats latest(_time) as _time, latest(profile.department) as bunit, latest(profile.legacyUsername) as legacyUsername, latest(profile.userType) as category by userID
| append [|inputlookup user_ids]

 


In all the posts i have seen so far, people recommend using outputlookup command to append  

Can someone pls explain  how does append [|inputlookup user_identities]  end up appending  in my case ? How is this different than 

| outputlookup append=true user_ids.csv 
Labels (2)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @neerajs_81,

the append command is use to append the results of a subsearch (also from a lookup) to the results of the main search.

If I correctly understood, you need to append the results of a search to a lookup, if this is correct, you have to use the outputlookup.

You can find information about both the commands at 

https://docs.splunk.com/Documentation/Splunk/8.2.4/SearchReference/Append 

https://docs.splunk.com/Documentation/Splunk/8.2.4/SearchReference/Outputlookup

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @neerajs_81,

the append command is use to append the results of a subsearch (also from a lookup) to the results of the main search.

If I correctly understood, you need to append the results of a search to a lookup, if this is correct, you have to use the outputlookup.

You can find information about both the commands at 

https://docs.splunk.com/Documentation/Splunk/8.2.4/SearchReference/Append 

https://docs.splunk.com/Documentation/Splunk/8.2.4/SearchReference/Outputlookup

Ciao.

Giuseppe

neerajs_81
Builder

Thanks. So in my search what does 

| append [|inputlookup user_ids]

achieve?   Is it appending the results to that user_ids lookup file ? 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @neerajs_81,

no it appends the rows of the lookup TO your search results, not To the lookup!

In other words: "| append [|inputlookup user_ids]" appends FROM user_id.csv not TO this lookup.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...