Splunk Search

splunk merge field values

viku7474
Engager

I have a field called environment which has values like dev,prod,uat,sit.
Now I want to create a new_field which all the field values of environment field.

Example: (4 field values)
environment 
dev
prod
uat
sit

After query: ( 1 field value, separated by any string)
merge_environment= dev | prod | uat | sit

How to achieve this?

Labels (6)
Tags (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Space separated

| stats values(environment) as merge_environment
| nomv merge_environment

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Space separated

| stats values(environment) as merge_environment
| nomv merge_environment
0 Karma

viku7474
Engager

@ITWhisperer  Thank you!!

It works, Since I am passing this token in mail subject, can I separate it by comma or hyphen.?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Instead of using nomv, try this

| eval merged_environment=mvjoin(merged_environment, ",")
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...