Splunk Search

Why is checkbox not working?

POR160893
Builder

Hi,

I have created a dashboard to filter firewall statuses. One of the inputs I need is a checkbox to eliminate duplicates based on host, source IP, destination IP and destination port. 

However, the checkbox input is not working and every time the use checks and unchecks the box, it has no effect on the dashboard.

The following is my dashboard and the XML code, respectively:

Checkbox Not Working UI.PNGCheckbox Not Working.PNG

Can you please help?

Thank you!

Labels (1)
Tags (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please share the part of the dashboard code that uses the $checkboxDedup$ token.

---
If this reply helps you, Karma would be appreciated.
0 Karma

POR160893
Builder

At the moment, this token is not been used.

I don't know how to incorporate it into one of my queries so that duplicates over 4 fields are detected.


As you can see from the below code, I am already using the tokens from the other inputs in the base searches:

3 base queries.PNG

However, for this checkbox, since I need to detect duplicates across source IP, dest IP, dest Port AND sourcetype, and I am already using a sourcetype token in my dropdown, I don't know how to make use make use of the 1 token in the checkbox when it would make sense to have 4 tokens ....... can you please help

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I think you only need one token, not 4 for dedup.  Just add the token between the table and first lookup commands.

| table ...
$checkboxDedup$
| lookup ...

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

POR160893
Builder

When I added the dedup in between the table and lookup, the UI is now looking for some argument:

Dedup Not Working - UI.PNGDedup Not Working - Code.PNG


Can you  please help?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Since the token already contains a dedup command, saying | dedup $checkboxDedup$ is equivalent to saying | dedup | dedup $sourcetype_tok$, $dest$, $src$, $port$.

Try the answer provided or change the token to not contain "| dedup

---
If this reply helps you, Karma would be appreciated.

POR160893
Builder

Hey, The submit button with the Dedup condition does work now .... but only on fields with the same name across both indexes. Here is the source query with the Dedup token been used:Dedup Not Working - Code1.PNG

However, I need to also have it check for dedup for src_ip and dest_ip. My issue is on the 2nd index, these two fields are called src and dest, respectively.

Dedup Not Working - Code2.PNG

I tried using both names with an OR in the dedup but that did not work. Can you please help?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The dedup command does not accept expressions - only field names.  You'll probably need to normalize the field names using rename or coalesce (or other method) for dedup to work as expected.

---
If this reply helps you, Karma would be appreciated.
0 Karma

Marco_Develops
Path Finder

Have you considered using the submit button? In order to use the submit button you have to change  "search on change" off on all your other inputs.

-Marco

0 Karma

POR160893
Builder

The submit button with the Dedup condition does work now .... but only on fields with the same name across both indexes. Here is the source query with the Dedup token been used:Dedup Not Working - Code1.PNG

However, I need to also have it check for dedup for src_ip and dest_ip. My issue is on the 2nd index, these two fields are called src and dest, respectively.

Dedup Not Working - Code2.PNG

I tried using both names with an OR in the dedup but that did not work. Can you please help?

0 Karma

schalb
Engager

I've had the exact same use case and found a work around. Added this just in case anyone else stumbles across it.

Update the default option to noop, so it reverts to this when the checkbox is deselected
<input type="checkbox" token="dedupresults">
<choice value="dedup src,dest">Dedup</choice>
<default>noop</default>
</input>

And insert the token into your search. 
.... | $dedupresults$ | .....

This will result in the search being either

... | dedup src,dest | .....  or ... | noop | .....

Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...