{"id":77487,"date":"2023-09-13T12:08:49","date_gmt":"2023-09-13T12:08:49","guid":{"rendered":"https:\/\/merikebi.warrenmyers.com\/?p=77487"},"modified":"2023-09-13T12:08:49","modified_gmt":"2023-09-13T12:08:49","slug":"answer-by-warren-for-how-can-a-dropdown-be-used-to-filter-splunk-query-results","status":"publish","type":"post","link":"https:\/\/merikebi.warrenmyers.com\/?p=77487","title":{"rendered":"Answer by warren for How Can a Dropdown be Used to Filter Splunk Query Results"},"content":{"rendered":"<p>The simplest way to do this will be to create a list in your dropdown who entry <em>values<\/em> are the field names (ie <code>Model.Old<\/code> &amp; <code>Model.New<\/code>)<\/p>\n<p>Call the name of that token, say, <code>modelchoice<\/code><\/p>\n<p>Then have a single search on your dashboard that looks like this:<\/p>\n<pre><code>index='splunk_demo' source='demo.zip'\n| fields Name, Model.New, Model.Old, Price\n| chart count(Name) by $modelchoice$\n<\/code><\/pre>\n<p>Splunk does a straight substitution when it encounters a token with whatever the token&#8217;s value is.<\/p>\n<p>So if the token&#8217;s value is the field name, it will substitute that in<\/p>\n<p>from User warren &#8211; Stack Overflow https:\/\/stackoverflow.com\/questions\/77094074\/how-can-a-dropdown-be-used-to-filter-splunk-query-results\/77096911#77096911<br \/>\nvia <a href=\"https:\/\/ifttt.com\/?ref=da&#038;site=wordpress\">IFTTT<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The simplest way to do this will be to create a list in your dropdown who entry values are the field names (ie Model.Old &amp; Model.New) Call the name of that token, say, modelchoice Then have a single search on your dashboard that looks like this: index=&#8217;splunk_demo&#8217; source=&#8217;demo.zip&#8217; | fields Name, Model.New, Model.Old, Price | &hellip;<br \/><a href=\"https:\/\/merikebi.warrenmyers.com\/?p=77487\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Answer by warren for How Can a Dropdown be Used to Filter Splunk Query Results<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[991],"keyring_services":[],"class_list":["post-77487","post","type-post","status-publish","format-standard","hentry","category-blih","tag-stackexchange"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/77487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77487"}],"version-history":[{"count":1,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/77487\/revisions"}],"predecessor-version":[{"id":77488,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=\/wp\/v2\/posts\/77487\/revisions\/77488"}],"wp:attachment":[{"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77487"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/merikebi.warrenmyers.com\/index.php?rest_route=%2Fwp%2Fv2%2Fkeyring_services&post=77487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}