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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...