Getting Data In

How can i append the values of one field to another field?

kartik13
Communicator

I have two different fields, but they have the same type of value for eg. "host". So How can I join two fields to have one field with all the hosts?
I have to use some tags with the search, so I'm trying to find some way to deal with this problem, and the tag is related to host and classifies the host based on the environment.

Tags (3)
0 Karma
1 Solution

chimell
Motivator
try this search 
| set union [search  ...... | fields host ] [search ...... | fields host ]|table host 

just replace ....... by something and try

View solution in original post

chimell
Motivator
try this search 
| set union [search  ...... | fields host ] [search ...... | fields host ]|table host 

just replace ....... by something and try

chimell
Motivator

thank for your accepted answer

0 Karma

emiller42
Motivator

Couple ways to tackle this.

  • At search time, you can coalesce multiple fields as 'host' ...| eval host=coalesce(field1, field2, ..., fieldN)
  • You can create field aliases to give fields multiple names. Example, you have some data which has a src_host field, and you'd like that field to be included in any host=... searches. Go to Settings > Fields > Field Aliases and add a new config saying src_host = host
0 Karma

kartik13
Communicator

i want to use a tag i want to include the tag after i have joined the two fields .. is there any way to do tht becuase tag doent produce any result if i use aftr eval command

0 Karma

emiller42
Motivator

Do the tags work if you create a field alias?

0 Karma

ramdaspr
Contributor

can you add a sample of the input data and a sample output you are trying to achieve?

kartik13
Communicator

2015-03-04T06:24:25+00:00 *_Alarm WARN Profiler Queue Size Limit Reached : Server=rtp-prd-02; Profiler Error Message=1030 EventHandler events dropped;host=****

i want to make host and server as one field . with having all values in host plus with the values of Server.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...