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!

There's No Place Like Chrome and the Splunk Platform

Watch On DemandMalware. Risky Extensions. Data Exfiltration. End-users are increasingly reliant on browsers to ...

The Great Resilience Quest: 5th Leaderboard Update

The fifth leaderboard update for The Great Resilience Quest is out >> 🏆 Check out the ...

Devesh Logendran, Splunk, and the Singapore Cyber Conquest

At this year’s Splunk University, I had the privilege of chatting with Devesh Logendran, one of the winners in ...