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!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...