Splunk Enterprise

Group my accounts

jamfal
New Member

I'm new to Splunk and my problem is:
I have a field called Environment which is composed of 7 elements (Backup, Production Pre-Production, Recipe, Qualification, Development, Integration).

And I wanted to group my accounts into 2 groups Production (Production, Pre-Prod, Backup) and off Prod (Recipe, development, qualification, integration

Thanks

Tags (1)
0 Karma
1 Solution

niketn
Legend

You can pipe the following eval:

<Your Base Search>
| eval EnvironmentGroups=case(Environment="Backup" OR Environment="Pre-Prod" OR Environment="Production","Production", true(), "off Prod")

PS: You can also create a Calculated Field for the above if it applies for All events and all searches that you run.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

dineshraj9
Builder

Try updating the same field or creating a new field -

| eval Environment=case(Environment=="Backup", "Production", Environment=="Pre-Prod", "Production", Environment=="Production","Production",Environment=="Recipe", "Off Prod", Environment=="Development", "Off Prod", Environment=="Qualification","Off Prod", Environment=="Integration","Off Prod")

OR

| eval ENV=case(Environment=="Backup", "Production", Environment=="Pre-Prod", "Production", Environment=="Production","Production",Environment=="Recipe", "Off Prod", Environment=="Development", "Off Prod", Environment=="Qualification","Off Prod", Environment=="Integration","Off Prod")

Note: Field names are case sensitive.

0 Karma

niketn
Legend

You can pipe the following eval:

<Your Base Search>
| eval EnvironmentGroups=case(Environment="Backup" OR Environment="Pre-Prod" OR Environment="Production","Production", true(), "off Prod")

PS: You can also create a Calculated Field for the above if it applies for All events and all searches that you run.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...