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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...