Splunk Search

Use token just if is defined

maaneeel
Explorer

Hello,

I need to create a dashboard panel (table) doing a query that uses the following filtering condition:

account_name = "$userNameToken$")

How could I prevent the situation where the token is not defined and display any user?

Thanks

Labels (1)
Tags (1)
0 Karma

maaneeel
Explorer

Thanks for the answers.

 

Using  search account_name = * works properly, but I would like to remove the default value (*) from the input textbox, just to prevent that when the analyst finish a search of a specific user, doesn't need to type * again to display any user.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

I am not sure what the issue is here - is the "analyst" removes the name from the text box, it will be set to the default i.e. "*" without them having to type it again - does this not give you the functionality you want?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Set the default value of the token to *

How are you setting the token in the first place?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If the token is not defined then the query will not run.  To prevent that, set a default value for the token.

---
If this reply helps you, Karma would be appreciated.
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 ...