Splunk Dev

Lookup table disappears after deleting all rows

nabeel652
Builder

I have a lookup table for exclusions. that updates when user clicks on a value and it is added in the lookup table. However, if the user clicks on the row in lookup table it is removed from the lookup.

It works fine but the problem is that when the user clicks on last row present in the lookup table the table disappears and I have to populate the lookup table again using:

| stats count | eval Ignore=""  | eval Publisher="" | eval Product="" | eval Append=""  | eval Version="" | fields - count| outputlookup exclusions.csv

Question is that can I add some code in my search to avoid this thing to happen. My search is:

| inputlookup exclusions  | append [| stats count | eval Publisher="Igor Pavlov" | eval Product="7-Zip 16.00 (x64 edition)" | eval Version = "16.00.00.0" | eval Ignore = 1  | eval Append="0"] | sort by Append  | dedup Publisher Product Version | where Append="1" | table Publisher Product Version Ignore Append | outputlookup exclusions.csv

All evals are drilldown tokens from the previous/same page.

Tags (1)
1 Solution

somesoni2
Revered Legend

Try like this

| inputlookup exclusions  | append [| stats count | eval Publisher="Igor Pavlov" | eval Product="7-Zip 16.00 (x64 edition)" | eval Version = "16.00.00.0" | eval Ignore = 1  | eval Append="0"] | sort by Append  | dedup Publisher Product Version | where Append="1" | table Publisher Product Version Ignore Append | appendpipe [ | stats count | where count=0 | eval Ignore=""  | eval Publisher="" | eval Product="" | eval Append=""  | eval Version="" | fields - count ]| outputlookup exclusions.csv 

View solution in original post

0 Karma

somesoni2
Revered Legend

Try like this

| inputlookup exclusions  | append [| stats count | eval Publisher="Igor Pavlov" | eval Product="7-Zip 16.00 (x64 edition)" | eval Version = "16.00.00.0" | eval Ignore = 1  | eval Append="0"] | sort by Append  | dedup Publisher Product Version | where Append="1" | table Publisher Product Version Ignore Append | appendpipe [ | stats count | where count=0 | eval Ignore=""  | eval Publisher="" | eval Product="" | eval Append=""  | eval Version="" | fields - count ]| outputlookup exclusions.csv 
0 Karma

DalJeanis
Legend

is that | inputlookup exclusions or | inputlookup exclusions.csv ?

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...