Splunk Search

How to merge two fields values into a single field?

Allampally
Path Finder

Hi,

I have the below stats result

**Service          Method               Action**
Service1                  Method1                 NULL
Service2                  Method2                 NULL
Service3                  NULL                Method3
Service4                  NULL                Method4

Now I want to merge Method and Action Fields into a single field by removing NULL values in both fields.

1 Solution

xpac
SplunkTrust
SplunkTrust

Hey,

This looks like the perfect use case for coalesce():

| eval Method=coalesce(Method, Action)

Read up on its details here:
http://docs.splunk.com/Documentation/Splunk/7.1.0/SearchReference/ConditionalFunctions

View solution in original post

xpac
SplunkTrust
SplunkTrust

Hey,

This looks like the perfect use case for coalesce():

| eval Method=coalesce(Method, Action)

Read up on its details here:
http://docs.splunk.com/Documentation/Splunk/7.1.0/SearchReference/ConditionalFunctions

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...