<?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 Create Dynamic Drop-down in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680328#M232532</link>
    <description>&lt;P&gt;I am trying to create a dashboard to examine group policy processing errors.&amp;nbsp; I would like to create a drop-down based on the values returned for EventCode which is the Windows EventID.&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; How do I create a dynamic drop-down to show the EventIDs (EventCode) returned by the search?&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; I see you can enter a whole new search, but technically that is different than the main search, right?&amp;nbsp; How do I base it on the main search?&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; What are Label (fieldForLabel) and Value (fieldForValue) for?&amp;nbsp; Why are they required?&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;&amp;lt;form version="1.1" theme="light"&amp;gt;
  &amp;lt;label&amp;gt;GP Errors&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-90m@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="text" token="Computername"&amp;gt;
      &amp;lt;label&amp;gt;Computer Name&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="EventID"&amp;gt;
      &amp;lt;label&amp;gt;Event ID&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;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;EventID&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;EventID&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=winevent source="WinEventLog:System" SourceName="Microsoft-Windows-GroupPolicy" Type=Error 
| stats values(EventCode)&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-90m@m&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;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=winevent source="WinEventLog:System" SourceName="Microsoft-Windows-GroupPolicy" Type=Error host=$Computername$ EventCode=$EventID$
| table  host, EventCode, Message, _time
| rename host AS Host, EventCode AS EventID
| sort _time desc&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-90m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&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="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="percentagesRow"&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2024 21:39:06 GMT</pubDate>
    <dc:creator>CoryC</dc:creator>
    <dc:date>2024-03-11T21:39:06Z</dc:date>
    <item>
      <title>Create Dynamic Drop-down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680328#M232532</link>
      <description>&lt;P&gt;I am trying to create a dashboard to examine group policy processing errors.&amp;nbsp; I would like to create a drop-down based on the values returned for EventCode which is the Windows EventID.&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; How do I create a dynamic drop-down to show the EventIDs (EventCode) returned by the search?&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; I see you can enter a whole new search, but technically that is different than the main search, right?&amp;nbsp; How do I base it on the main search?&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; What are Label (fieldForLabel) and Value (fieldForValue) for?&amp;nbsp; Why are they required?&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;&amp;lt;form version="1.1" theme="light"&amp;gt;
  &amp;lt;label&amp;gt;GP Errors&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-90m@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="text" token="Computername"&amp;gt;
      &amp;lt;label&amp;gt;Computer Name&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="EventID"&amp;gt;
      &amp;lt;label&amp;gt;Event ID&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;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;EventID&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;EventID&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=winevent source="WinEventLog:System" SourceName="Microsoft-Windows-GroupPolicy" Type=Error 
| stats values(EventCode)&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-90m@m&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;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=winevent source="WinEventLog:System" SourceName="Microsoft-Windows-GroupPolicy" Type=Error host=$Computername$ EventCode=$EventID$
| table  host, EventCode, Message, _time
| rename host AS Host, EventCode AS EventID
| sort _time desc&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-90m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&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="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="percentagesRow"&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 21:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680328#M232532</guid>
      <dc:creator>CoryC</dc:creator>
      <dc:date>2024-03-11T21:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Drop-down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680334#M232533</link>
      <description>&lt;P&gt;The events returned by the search can have multiple fields,; the fieldsFor... elements defile which fields from the search are used for the label and which is used for the value.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2024 23:09:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680334#M232533</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-03-11T23:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Drop-down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680347#M232536</link>
      <description>&lt;P&gt;To make a common search, use a base search that is then used by both other searches. The details will need to be common enough.&lt;/P&gt;&lt;P&gt;Your main table has a search window of 90m - do you expect a large number of events in this data set. This table does not really do any aggregations, so using this as a base search is not really good idea. You would need 3 searches, the base and one for the dropdown and the other for the data table.&lt;/P&gt;&lt;P&gt;See this (untested) and compare it to your dashboard - it fixes your dropdown issue, creates a base search used by the other two searches and they all use the same time picker values.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1" theme="light"&amp;gt;
  &amp;lt;label&amp;gt;GP Errors&amp;lt;/label&amp;gt;
  &amp;lt;search id="base"&amp;gt;
    &amp;lt;query&amp;gt;index=winevent source="WinEventLog:System" SourceName="Microsoft-Windows-GroupPolicy" Type=Error 
| stats count by _time host EventCode Message
| rename host AS Host, EventCode AS EventID
    &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$field1.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$field1.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="time" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;
        &amp;lt;earliest&amp;gt;-90m@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="text" token="Computername"&amp;gt;
      &amp;lt;label&amp;gt;Computer Name&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="EventID"&amp;gt;
      &amp;lt;label&amp;gt;Event ID&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;initialValue&amp;gt;*&amp;lt;/initialValue&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;EventID&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;EventID&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search base="base"&amp;gt;
        &amp;lt;query&amp;gt;
| stats count by EventID&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;search base="base"&amp;gt;
          &amp;lt;query&amp;gt;
search Host=$Computername$ EventID=$EventID$
| table  Host, EventID, Message, _time count
| sort - _time&amp;lt;/query&amp;gt;
        &amp;lt;/search&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="percentagesRow"&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;&lt;P&gt;&amp;nbsp;Note that you also need to consider dependencies - should the list of eventids in the dropdown be ones that are found only for the entered computer? If not, then when you select an ID it may not exist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 06:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680347#M232536</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-03-12T06:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Drop-down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680348#M232537</link>
      <description>&lt;P&gt;See this for base search documentation&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.0/Viz/Savedsearches" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.0/Viz/Savedsearches&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 06:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680348#M232537</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-03-12T06:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create Dynamic Drop-down</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680737#M232669</link>
      <description>&lt;P class="lia-align-left"&gt;Thank you,&amp;nbsp; This worked for what I asked for.&amp;nbsp; Group Policy runs every 90-120 minutes so this should return most PCs with errors without duplicating them.&amp;nbsp; We have about 1000 computers and seem to have about 100 with errors, so this will return about 100 results for the 90 min.&amp;nbsp; 90 min is all I really need to search, maybe 120, but I chose 90.&amp;nbsp; I can dig into the data more after getting these quick results.&amp;nbsp; I did realize I probably need all results, not just errors if I Enter a PC, but I can work on that.&amp;nbsp; I think if I enter a PC, I want all EventIDs, and if I enter an EventID, I want all PCs with that EventID.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thank you again.&amp;nbsp; This is working as asked.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 18:44:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Dynamic-Drop-down/m-p/680737#M232669</guid>
      <dc:creator>CoryC</dc:creator>
      <dc:date>2024-03-14T18:44:34Z</dc:date>
    </item>
  </channel>
</rss>

