<?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 Re: Dynamic drop down from field values in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688752#M56394</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249143"&gt;@mahesh27&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can write an eval condition to rename the NULL value as whatever string you wish.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval service_code=if(service_code="NULL","Non-Servicecode",service_code)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Just append the above eval condition to your SPL query and it should work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Tejas.&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2024 06:55:56 GMT</pubDate>
    <dc:creator>tej57</dc:creator>
    <dc:date>2024-05-27T06:55:56Z</dc:date>
    <item>
      <title>Dynamic drop down from field values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688227#M56342</link>
      <description>&lt;P&gt;Logs are in JSON format and we want to get this attribute.app.servicecode field values as a drop down in classic dashboard.&lt;/P&gt;&lt;P&gt;Query: index=application-idx&amp;nbsp; |stats count by attribute.app.servicecode&lt;/P&gt;&lt;P&gt;How to get this field values in a drop down????&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 01:01:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688227#M56342</guid>
      <dc:creator>mahesh27</dc:creator>
      <dc:date>2024-05-22T01:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic drop down from field values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688245#M56347</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249143"&gt;@mahesh27&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Ideally&amp;nbsp;&lt;SPAN&gt;attribute.app.servicecode should populate the dropdown. However, for simplified usage, you can use either rename or spath command to give a simple field name for use in the dashboard. Your XML input should look something like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="service_code_token"&amp;gt;
      &amp;lt;label&amp;gt;Service Code&amp;lt;/label&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;service_code&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;service_code&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=application-idx |rename "attribute.app.servicecode" as service_code |stats count by service_code | fields service_code&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;After setting the input, to use the selected service_code value in subsequent panels, you can mention&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| search service_code="$service_code_token$"&lt;/PRE&gt;&lt;P&gt;OR&lt;/P&gt;&lt;PRE&gt;| search "attribute.app.servicecode"="$service_code_token$"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Tejas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;If the above solution helps, an upvote is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2024 06:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688245#M56347</guid>
      <dc:creator>tej57</dc:creator>
      <dc:date>2024-05-22T06:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic drop down from field values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688641#M56388</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/155831"&gt;@tej57&lt;/a&gt;&amp;nbsp;, thank you for sharing the code, it's working but when we run this query we see we getting field values as "Null"&lt;/P&gt;&lt;P&gt;Eg:&lt;/P&gt;&lt;P&gt;Service.app.116&lt;/P&gt;&lt;P&gt;Service.ast.24&lt;/P&gt;&lt;P&gt;Service.srt.22&lt;/P&gt;&lt;P&gt;Null&lt;/P&gt;&lt;P&gt;Is there a chance to rename this null as non-service&lt;SPAN&gt;code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2024 18:30:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688641#M56388</guid>
      <dc:creator>mahesh27</dc:creator>
      <dc:date>2024-05-24T18:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic drop down from field values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688752#M56394</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249143"&gt;@mahesh27&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can write an eval condition to rename the NULL value as whatever string you wish.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval service_code=if(service_code="NULL","Non-Servicecode",service_code)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Just append the above eval condition to your SPL query and it should work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Tejas.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 06:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688752#M56394</guid>
      <dc:creator>tej57</dc:creator>
      <dc:date>2024-05-27T06:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic drop down from field values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688785#M56402</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/155831"&gt;@tej57&lt;/a&gt;, I tried below Evan condition its working when I run it in a search but when I add in the xml code it’s showing in the dropdown but values are not populating on the panels.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 14:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688785#M56402</guid>
      <dc:creator>mahesh27</dc:creator>
      <dc:date>2024-05-27T14:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic drop down from field values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688821#M56410</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249143"&gt;@mahesh27&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Can you share your XML source code and that can help understand why the input isn't working as required?&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Tejas.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 04:54:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/688821#M56410</guid>
      <dc:creator>tej57</dc:creator>
      <dc:date>2024-05-28T04:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic drop down from field values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/689228#M56455</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/155831"&gt;@tej57&lt;/a&gt;&amp;nbsp;, pls find the xml below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="light"&amp;gt;
    &amp;lt;label&amp;gt;Dashboard&amp;lt;/label&amp;gt;
    &amp;lt;fieldset submitButton="false"&amp;gt;
        &amp;lt;input type="time" token="timepicker"&amp;gt;
            &amp;lt;label&amp;gt;TimeRange&amp;lt;/label&amp;gt;
            &amp;lt;default&amp;gt;
                &amp;lt;earliest&amp;gt;-15m@m&amp;lt;/earliest&amp;gt;
                &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/default&amp;gt;
        &amp;lt;/input&amp;gt;
        &amp;lt;input type="dropdown" token="servicecode"&amp;gt;
            &amp;lt;label&amp;gt;Code&amp;lt;/label&amp;gt;
            &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
            &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
            &amp;lt;fieldForLabel&amp;gt;service_code&amp;lt;/fieldForLabel&amp;gt;
            &amp;lt;fieldForValue&amp;gt;service_code&amp;lt;/fieldForValue&amp;gt;
          &amp;lt;search&amp;gt;
              &amp;lt;query&amp;gt;
                  index=application-idx |rename "attribute.app.servicecode" as service_code | eval service_code=if(service_code="NULL","Non-Servicecode",service_code) |stats count by service_code | fields service_code              &amp;lt;/query&amp;gt;
          &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;/fieldset&amp;gt;
    &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
            &amp;lt;table&amp;gt;
                &amp;lt;title&amp;gt;Incoming Count &amp;amp;amp; Total Count&amp;lt;/title&amp;gt;
                &amp;lt;search&amp;gt;
                    &amp;lt;query&amp;gt;
                        index=application-idx AND attribute.app.servicecode="$servicecode$"
                        source=application.logs 
                       |stats count                        
                       
                    &amp;lt;/query&amp;gt;
                    &amp;lt;earliest&amp;gt;timepicker.earliest&amp;lt;/earliest&amp;gt;
                    &amp;lt;latest&amp;gt;timepicker.latest&amp;lt;/latest&amp;gt;
                    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
                &amp;lt;/search&amp;gt;
                &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
                &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
                &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
                &amp;lt;option name="percentageRow"&amp;gt;false&amp;lt;/option&amp;gt;
                &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
                &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
                &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
                &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
            &amp;lt;/table&amp;gt;
        &amp;lt;/panel&amp;gt;
    &amp;lt;/row&amp;gt;
&amp;lt;form&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 31 May 2024 15:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-drop-down-from-field-values/m-p/689228#M56455</guid>
      <dc:creator>mahesh27</dc:creator>
      <dc:date>2024-05-31T15:20:22Z</dc:date>
    </item>
  </channel>
</rss>

