Splunk Search

Create a New field on an event by evaluating two different event values

CryoHydra
Path Finder

Hello Splunkers,

Facing one issue in identifying Creator_Process_Name,

In windows process creation event we have New_Process_ID, New_Process_Name, Creator_Process_ID -- using this we cannot identify Process which created the New_Process_Name , but there is a chance where Creator_Process_ID=New_Process_ID in some other event so from that event i need to populate Creator_Process_Name

For e.g

index=wineventlog hostname1 |eval Creator_Process_Name=if(Creator_Process_ID=="New_Process_ID", New_Process_Name,NULL) 
Tags (1)
0 Karma

woodcock
Esteemed Legend

Show us sample events and a mockup of the desired output.

0 Karma

tiagofbmm
Influencer

Seems what you're looking for is a straight comparison between the two fields, not one field compared to a string:

index=wineventlog hostname1 |eval Creator_Process_Name=if(Creator_Process_ID==New_Process_ID, New_Process_Name,NULL)

What do you think ?

0 Karma

CryoHydra
Path Finder

Yes you are right, but this query is not creating Creator_Process_Name field.

0 Karma

tiagofbmm
Influencer

If this field is not created, it's one of two cases:

1 - either Creator_Process_ID or New_Process_ID fields do not exist
2 - Creator_Process_ID is never equal to New_Process_ID

In any of the two cases, Creator_Process_Name will be null for all the events, and so the field doesn't event get "created" (shown).

Please check those cases.

P.S. This is how I'd put the query anyway.
index=wineventlog hostname1 |eval Creator_Process_Name=if(Creator_Process_ID=New_Process_ID, New_Process_Name,null())

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...