Splunk Search

How to merge values of the same field extraction?

shivarpith
Path Finder

I have 4 unique and standard values under one field extraction topic. I want to combine them into two values and use the output for my tokens in dashboard panels.

topic   | count
A       | 10
Aa      | 10
B       | 5
bb      | 5

Required output

topic   | count
A       | 20
B       | 10
0 Karma

somesoni2
Revered Legend

Can we have to some real sample output? What type of values does the field topic contains?

0 Karma

sundareshr
Legend

Try this

base search | stats sum(eval(if(match(topic, "^([A|a])", count, null()) )) as A sum(eval(if(match(topic, "^([B|b])", count, null()) )) as B 
0 Karma
Get Updates on the Splunk Community!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...