<?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 Help with Creating a Dynamic Dropdown for Months and Year in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332961#M21584</link>
    <description>&lt;P&gt;I'm trying to create dropdown menus, one for the Month and another for the Year, that use dynamic options and timepicker 'today' to default to Current Month and Current Year.  I have tested that part successfully.  &lt;/P&gt;

&lt;P&gt;My question is I'm looking to fill the rest of my dropdown menus 'Month' and 'Year' with previous months and years so I can also search historical data.  I have been testing using output lookup tables but I don't have a lot of experience using that option and hoping the community has a few possible options to try out. &lt;/P&gt;

&lt;P&gt;Testing query : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* 
| eval Time=strftime(_time, "%m/%d/%Y %I:%M:%S %p")
| rex field=Time "(?&amp;lt;date_month&amp;gt;\d+)/"
| rex field=Time "(?&amp;lt;date_year&amp;gt;\d{4})"
| dedup date_month
| dedup date_year
| table date_month, date_year
| output date_lookup
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 07 Mar 2018 02:50:45 GMT</pubDate>
    <dc:creator>johnward4</dc:creator>
    <dc:date>2018-03-07T02:50:45Z</dc:date>
    <item>
      <title>Help with Creating a Dynamic Dropdown for Months and Year</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332961#M21584</link>
      <description>&lt;P&gt;I'm trying to create dropdown menus, one for the Month and another for the Year, that use dynamic options and timepicker 'today' to default to Current Month and Current Year.  I have tested that part successfully.  &lt;/P&gt;

&lt;P&gt;My question is I'm looking to fill the rest of my dropdown menus 'Month' and 'Year' with previous months and years so I can also search historical data.  I have been testing using output lookup tables but I don't have a lot of experience using that option and hoping the community has a few possible options to try out. &lt;/P&gt;

&lt;P&gt;Testing query : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* 
| eval Time=strftime(_time, "%m/%d/%Y %I:%M:%S %p")
| rex field=Time "(?&amp;lt;date_month&amp;gt;\d+)/"
| rex field=Time "(?&amp;lt;date_year&amp;gt;\d{4})"
| dedup date_month
| dedup date_year
| table date_month, date_year
| output date_lookup
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 02:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332961#M21584</guid>
      <dc:creator>johnward4</dc:creator>
      <dc:date>2018-03-07T02:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Creating a Dynamic Dropdown for Months and Year</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332962#M21585</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;P&gt;| dedup date_month&lt;BR /&gt;
 | dedup date_year&lt;BR /&gt;
↓&lt;BR /&gt;
 | dedup date_month,date_year&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332962#M21585</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2020-09-29T18:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Creating a Dynamic Dropdown for Months and Year</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332963#M21586</link>
      <description>&lt;P&gt;Thanks @HiroshiSatoh  Have you worked with populating dropdown menus dynamically or with lookups before?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 18:40:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332963#M21586</guid>
      <dc:creator>johnward4</dc:creator>
      <dc:date>2018-03-07T18:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Creating a Dynamic Dropdown for Months and Year</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332964#M21587</link>
      <description>&lt;P&gt;It is a sample dynamically setting a dropdown from the event log.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="yyyymm"&amp;gt;
    &amp;lt;label&amp;gt;Target Month&amp;lt;/label&amp;gt;
    &amp;lt;populatingSearch fieldForValue="trng" fieldForLabel="yyyymm"&amp;gt;
         &amp;lt;![CDATA[source="WinEventLog:System" (EventCode=6005 OR EventCode=6006) | table _time | eval yyyymm=strftime(_time,"%m/%Y")|dedup yyyymm| eval sdate=substr(yyyymm,1,2)+"/01/"+substr(yyyymm,4,4)+":0:0:0" | eval edate=strftime(relative_time(strptime(sdate,"%m/%d/%Y:%H:%M:%S"),"+1month"),"%m/%d/%Y:%H:%M:%S")  |  eval trng="earliest="+sdate+" latest="+edate]]&amp;gt;
    &amp;lt;/populatingSearch&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Mar 2018 04:25:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-with-Creating-a-Dynamic-Dropdown-for-Months-and-Year/m-p/332964#M21587</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-03-13T04:25:43Z</dc:date>
    </item>
  </channel>
</rss>

