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!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...