Splunk Search

search user check

gitingua
Communicator

It is necessary to check if the user is in the index in this file or not. If not, then add to the file, if it is in the file, then nothing happens

file.csv 

usernameinfo1info2
johnabcdqwer

 

index = IndexName

usernameinfo1info2
Aramghjkqweiq

 

Condition, if the user is not found in the file, then write it to the file 

output 

usernameinfo1info2
johnabcdqwer
Aramghjkqweiq
Labels (5)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=IndexName
| table username info1 info2
| append [| inputlookup file.csv]
| dedup username
| outputlookup file.csv append=f

gitingua
Communicator

@ITWhisperer 

can it be done through "where"?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Can what be done through where?

0 Karma

gitingua
Communicator

example 
| where id != id_old or not match(username)

is it possible to write something similar

@ITWhisperer 

0 Karma

gitingua
Communicator

@ITWhisperer 

I have a check where two parameters are compared via "where"

example | where id != id_old

there are already users with ID in the file, and after verification new IDs are added. But it happens that a new user appears in the index. 

And it turns out if "| where id != id_old" it does not pass.  And I need to add a condition,if the check did not work "| where id != id_old", then check whether such a user exists at all in the file

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...