<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to change Splunk query dynamically based on user input from dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-Splunk-query-dynamically-based-on-user-input-from/m-p/624371#M51190</link>
    <description>&lt;P&gt;I have a splunk dashboard with dropdown as different client names : A,B,C,ALL.&lt;/P&gt;&lt;P&gt;There will be logs for each client and then I need to search and print the count of selected client from logs, I am able to do that if a user selects A ,B or C, but there is no such client as ALL, if a user selects all, I want to see all logs for A,B,C and sum them and show them in dashboard.&lt;/P&gt;&lt;P&gt;A log look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Client Map Details : {A=123, B=245, C=456}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a user selects A, we show 123 and plot on graph&lt;/P&gt;&lt;P&gt;If a user selects B, we show 245 and plot on graph&lt;/P&gt;&lt;P&gt;If a user selects C, we show 456 and plot on graph&lt;/P&gt;&lt;P&gt;Query for above:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=temp  sourcetype="xyz" "Client Map Details : " "A"  | rex field=_raw "A=(?&amp;lt;count&amp;gt;\d+)" |  table _time count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how can I change query based on user input "ALL" and run another splunk query that will see all such lines , and iterate over map and sum each value, 123+456+245 and then give a value to plot?&lt;/P&gt;&lt;P&gt;How do we change slunk query based on user input from dashboard ?&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2022 14:16:30 GMT</pubDate>
    <dc:creator>user9025</dc:creator>
    <dc:date>2022-12-15T14:16:30Z</dc:date>
    <item>
      <title>How to change Splunk query dynamically based on user input from dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-Splunk-query-dynamically-based-on-user-input-from/m-p/624371#M51190</link>
      <description>&lt;P&gt;I have a splunk dashboard with dropdown as different client names : A,B,C,ALL.&lt;/P&gt;&lt;P&gt;There will be logs for each client and then I need to search and print the count of selected client from logs, I am able to do that if a user selects A ,B or C, but there is no such client as ALL, if a user selects all, I want to see all logs for A,B,C and sum them and show them in dashboard.&lt;/P&gt;&lt;P&gt;A log look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Client Map Details : {A=123, B=245, C=456}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a user selects A, we show 123 and plot on graph&lt;/P&gt;&lt;P&gt;If a user selects B, we show 245 and plot on graph&lt;/P&gt;&lt;P&gt;If a user selects C, we show 456 and plot on graph&lt;/P&gt;&lt;P&gt;Query for above:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=temp  sourcetype="xyz" "Client Map Details : " "A"  | rex field=_raw "A=(?&amp;lt;count&amp;gt;\d+)" |  table _time count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how can I change query based on user input "ALL" and run another splunk query that will see all such lines , and iterate over map and sum each value, 123+456+245 and then give a value to plot?&lt;/P&gt;&lt;P&gt;How do we change slunk query based on user input from dashboard ?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 14:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-change-Splunk-query-dynamically-based-on-user-input-from/m-p/624371#M51190</guid>
      <dc:creator>user9025</dc:creator>
      <dc:date>2022-12-15T14:16:30Z</dc:date>
    </item>
  </channel>
</rss>

