Splunk Search

How to merge 2 lines in a table into one

mah
Builder

Hi,

I have a table like this : 

testcount
test AA1
test AB2
test C3

 

I want to merge "test AA" and "test AB" which will give me a count of 3 together.

What I want :

testcount
test A3
test C3

 

How Can I do that ?

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The best answer will depend on the nature of the test field, but this is one way to do it.

... | eval test = substr(test,1,6)
| stats count by test
---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Enhance Security Operations with Automated Threat Analysis in the Splunk EcosystemAre you leveraging ...

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...