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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...