Splunk Search

How to group together rows with similar names into a single row

sam1010
Explorer

sam1010_0-1629792492292.png

This is the table. How can I group together similar names into one entry and the count is added for both of them. For example 5-Mock Activity and 6-Mock activity should come in 1 row as "Mock Activity" and count for that field should be 19+5 i.e. 24  

Labels (5)
Tags (3)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@sam1010 

Just add this before stats command.

|rex field=environment "\d\s\-\s(?<environment>.*)"

KV 

0 Karma

sam1010
Explorer

yes it's working but the thing is there are many other fields which have similar names for example stage and staging, these two also need to be counted as one "Stage" how to do that?

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@sam1010 

You can replace those value by adding below search after rex command.

| replace "stag*" WITH "Stage" IN environment

 

KV 

Get Updates on the Splunk Community!

Build Scalable Security While Moving to Cloud - Guide From Clayton Homes

 Clayton Homes faced the increased challenge of strengthening their security posture as they went through ...

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...

Cloud Platform | Migrating your Splunk Cloud deployment to Python 3.7

Python 2.7, the last release of Python 2, reached End of Life back on January 1, 2020. As part of our larger ...