Splunk Search

Select all values from downdown list

hastrike
New Member

I have populated drop down input list in my dashboard and I am able to select all my options but everything I have tried using "*" as the wild card doesn't appear to work. Any help on how I can get an All value to select everything in the drop down and have the panels on my dashboard select all the values.

Like I said I was able to get it to work when I just select a single value.

Tags (1)
0 Karma

somesoni2
Revered Legend

Got the problem now. You're using "|where" clause for filter based on Domain. The wildcard for it is "%" not "*". So you got two option to solve your problem.

1) In dropdown, change the value for "All" option to %

replace All with All

2) In your query, replace where with search which accepts * as wildcard.

replace | where Ministry ="$Ministry$" with | searchMinistry ="$Ministry$"

0 Karma

somesoni2
Revered Legend

Not sure I understand the question fully here. So you don't get result in your dashboard panels if you select dropdown value as "All" ?

0 Karma

hastrike
New Member

that is correct, basically I can select a specific domain and it will query fine but if I want to select all to query all domains it doesn't do anything. Below is the code that is used for the drop down box.

0 Karma

somesoni2
Revered Legend

I don't see a problem with the dropdown. Could you post the panel query that is not returning results when your dropdown token is "*"?

0 Karma

hastrike
New Member

| dbquery mcafee "SELECT DISTINCT UPPER(EPOLeafNode.NodeName) AS Name, EPOLeafNode.LastUpdate AS mcafee_scantime,EPOComputerProperties.DomainName as Domain, EPOLeafNode.AgentVersion, EPOProdPropsView_VIRUSCAN.productversion AS VSEVersion, EPOProdPropsView_VIRUSCAN.enginever, EPOComputerProperties.OSType AS OS, EPOProdPropsView_VIRUSCAN.datver, RTRIM(EPOComputerProperties.userproperty1) AS McAfeeAssetTag, UPPER(EPOComputerProperties.userproperty3) as SerialNumber FROM EPOLeafNode LEFT JOIN EPOProdPropsView_SOLIDCORE ON EPOLeafNode.AutoID = EPOProdPropsView_SOLIDCORE.LeafNodeID LEFT JOIN EPOProdPropsView_EPOAGENT ON EPOLeafNode.AutoID = EPOProdPropsView_EPOAGENT.LeafNodeID LEFT JOIN EPOProdPropsView_VIRUSCAN ON EPOLeafNode.AutoID = EPOProdPropsView_VIRUSCAN.LeafNodeID LEFT JOIN EPOComputerProperties ON EPOLeafNode.AutoID = EPOComputerProperties.ParentID where EPOLeafNode.LastUpdate > DATEADD(MONTH, -1, GETDATE())" | table Name SerialNumber McAfeeAssetTag mcafee_scantime Domain OS AgentVersion VSEVersion enginever datver | eval mcafee_scantime = strftime(mcafee_scantime, "%F") | eval Datasource="Mcafee" | dedup Name | eval_ministries(Domain) | where Ministry ="$Ministry$" | stats count by AgentVersion

Like I said it works if I select the actual ministry just fine.

0 Karma

dgrubb_splunk
Splunk Employee
Splunk Employee

Try adding:

count: '-1'

to your code, so it will display all the results.

0 Karma

hastrike
New Member

Sorry I am not sure where I would put that?
Here is my code:

  <choice value="*">All</choice>
  <search>
    <query>index="lnf_snow_table_alm_hardware"  | dedup dv_company  | rename dv_company AS Domain | `eval_ministries(Domain)` | table Ministry | dedup Ministry |  sort by Ministry</query>
    <earliest>-30d@d</earliest>
    <latest>now</latest>
  </search>

Everything I seen online says to use quotes and * but I can't get it to work.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...