Splunk Search

How do you make a Splunk Dropdown based on a field from a string result?

starbac
Explorer

I have a Splunk search that returns a string with the format A;B;C I want to create a dropdown in a Splunk dashboard based on the first field (A).

So my problem here, is first, how do I extract the first string before the semicolon, and second, how do I use that field dynamically in the dropdown?

Tags (1)
0 Karma

niketn
Legend

@starbac if you would have provided your current query and field name with value "A;B;C". However, assuming your current field is called data, you can use the following command to extract first value A, using | eval value=replace(data,"^([^\;]+)\;(.*)","\1")

Please try the following run anywhere search to confirm!

| makeresults
| eval data="A;B;C"
| eval value=replace(data,"^([^\;]+)\;(.*)","\1")
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...