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!

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 ...