Splunk Search

How to delete repeated rows and only keep the values that have a reason?

crmarley20
Explorer

Hello, 

I need your help please, it happens that I have this table where when the technician enters the reason for its technical service is saved in splunk its previous value and the new change.

I need to delete the repeated rows and only keep the values that have a reason written by the technician.

crmarley20_0-1644672893345.png

 

 

Labels (5)
Tags (3)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

First of all, since you already use synthetic data, you should give that in text rather than screenshot.  It is so much easier for others to help if they can access data.

Second, when "The Tech. did not write", shouldn't the field grund be null/empty?  If that is the case, you can replace table with

| stats count by start end technician grund

 This is to use a side effect of groupby where no row is output when one of the groupby variables is null. (count is just a byproduct that you can discard.)

If the system that generates this data is so verbose that it actually output a string to say "The Tech. did not write", you can simply filter them out of events before table.

index=blah sourcetype=blah NOT "The Tech. did not write"
| table start end technicial grund

 

View solution in original post

woodcock
Esteemed Legend

You should not expect any help when you post pictures instead of the text.  Nobody is going to bother typing all that in from a photo.

crmarley20
Explorer

I am sorry, next time I will write the text, thank you very much for your answer.

0 Karma

yuanliu
SplunkTrust
SplunkTrust

First of all, since you already use synthetic data, you should give that in text rather than screenshot.  It is so much easier for others to help if they can access data.

Second, when "The Tech. did not write", shouldn't the field grund be null/empty?  If that is the case, you can replace table with

| stats count by start end technician grund

 This is to use a side effect of groupby where no row is output when one of the groupby variables is null. (count is just a byproduct that you can discard.)

If the system that generates this data is so verbose that it actually output a string to say "The Tech. did not write", you can simply filter them out of events before table.

index=blah sourcetype=blah NOT "The Tech. did not write"
| table start end technicial grund

 

crmarley20
Explorer

Thank you very much!

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...