Splunk Search

eval & coalesce

hagjos43
Contributor

I'm trying to normalize various user fields within Windows logs. The fields I'm trying to combine are users Users and Account_Name.

My query isn't failing but I don't think I'm quite doing this correctly.

I'm using the string:
| eval allusers=coalesce(users,Users,Account_Name)

Tags (2)

Ayn
Legend

coalesce takes a number of fields and returns the first one that is not null. So, if that's the behaviour you want, your query seems fine to me.

hagjos43
Contributor

I want to not have duplicates that may exist in both fields.
Jsmith may have logged onto a Win Server 2k3 box and the field is called "users" then he may log onto a win 2k8 box and the field is called "Users" The differences being the uppercase and lowercase "u"

0 Karma

Ayn
Legend

Do you want to concatenate those fields or use the first in that list that is not null?

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...