Splunk Search

How to hide duplicate values in consecutive table rows?

HarAtWork
Explorer

Hello! If I have this:

Letter Number
A 1
A 2
A 3
B 1
B 2

 

is there a way to get this:

 

Letter Number
A 1
  2
  3
B 1
  2

 

so that the transition from one set of related rows to the next is clear?

 

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Interesting question.  Most people want to fill in blanks so Splunk offers the fillnull and filldown commands.  There are no commands for the reverse, however.

You can accomplish the task using streamstats to count the rows by Letter and eval to replace the Letter with an empty string for all but the first row for each Letter.

| streamstats count by Letter
| eval Letter=if(count==1, Letter, "")

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Interesting question.  Most people want to fill in blanks so Splunk offers the fillnull and filldown commands.  There are no commands for the reverse, however.

You can accomplish the task using streamstats to count the rows by Letter and eval to replace the Letter with an empty string for all but the first row for each Letter.

| streamstats count by Letter
| eval Letter=if(count==1, Letter, "")

 

---
If this reply helps you, Karma would be appreciated.

HarAtWork
Explorer

That worked nicely, thank you!

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...