<?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 Dashboard Dropdown Question in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Dropdown-Question/m-p/498081#M32604</link>
    <description>&lt;P&gt;Hello all!&lt;/P&gt;

&lt;P&gt;I'm trying to build dropdowns in a dashboard for fields I've built via 'rex field' and eval statements seen in the search below.&lt;/P&gt;

&lt;P&gt;I am having trouble tying these fields into $token$ values.&lt;/P&gt;

&lt;P&gt;I've tried placing them into the search in a couple of different places, but the search just fails:&lt;/P&gt;

&lt;P&gt;Here is the search as it is built currently. Thanks for any direction you can provide.&lt;/P&gt;

&lt;P&gt;index=pcf_* cf_org_name="Network Software Development and Automation" cf_space_name="Development" cf_app_name=*privatecloud-dev* msg=*VALUES* *user_logs* &lt;STRONG&gt;user="$fields,0$"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;| rex field=msg "VALUES (?&amp;amp;lt;valuees&amp;amp;gt;.*)"&lt;/P&gt;

&lt;P&gt;| eval fields=split(valuees,"'") | eval user=mvindex(fields,0)&lt;/P&gt;

&lt;P&gt;| eval user=mvindex(fields,1)&lt;/P&gt;

&lt;P&gt;| eval method=mvindex(fields,3)&lt;/P&gt;

&lt;P&gt;| eval page=mvindex(fields,5)&lt;/P&gt;

&lt;P&gt;| eval params=mvindex(fields,7)&lt;/P&gt;

&lt;P&gt;| eval datetime =mvindex(fields,9)&lt;/P&gt;

&lt;P&gt;| &lt;STRONG&gt;search user=$"fields,0"$&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;| stats count by datetime user method page params&lt;/P&gt;</description>
    <pubDate>Fri, 20 Mar 2020 00:36:48 GMT</pubDate>
    <dc:creator>petersmiddy</dc:creator>
    <dc:date>2020-03-20T00:36:48Z</dc:date>
    <item>
      <title>Dashboard Dropdown Question</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Dropdown-Question/m-p/498081#M32604</link>
      <description>&lt;P&gt;Hello all!&lt;/P&gt;

&lt;P&gt;I'm trying to build dropdowns in a dashboard for fields I've built via 'rex field' and eval statements seen in the search below.&lt;/P&gt;

&lt;P&gt;I am having trouble tying these fields into $token$ values.&lt;/P&gt;

&lt;P&gt;I've tried placing them into the search in a couple of different places, but the search just fails:&lt;/P&gt;

&lt;P&gt;Here is the search as it is built currently. Thanks for any direction you can provide.&lt;/P&gt;

&lt;P&gt;index=pcf_* cf_org_name="Network Software Development and Automation" cf_space_name="Development" cf_app_name=*privatecloud-dev* msg=*VALUES* *user_logs* &lt;STRONG&gt;user="$fields,0$"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;| rex field=msg "VALUES (?&amp;amp;lt;valuees&amp;amp;gt;.*)"&lt;/P&gt;

&lt;P&gt;| eval fields=split(valuees,"'") | eval user=mvindex(fields,0)&lt;/P&gt;

&lt;P&gt;| eval user=mvindex(fields,1)&lt;/P&gt;

&lt;P&gt;| eval method=mvindex(fields,3)&lt;/P&gt;

&lt;P&gt;| eval page=mvindex(fields,5)&lt;/P&gt;

&lt;P&gt;| eval params=mvindex(fields,7)&lt;/P&gt;

&lt;P&gt;| eval datetime =mvindex(fields,9)&lt;/P&gt;

&lt;P&gt;| &lt;STRONG&gt;search user=$"fields,0"$&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;| stats count by datetime user method page params&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 00:36:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Dropdown-Question/m-p/498081#M32604</guid>
      <dc:creator>petersmiddy</dc:creator>
      <dc:date>2020-03-20T00:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Dropdown Question</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Dropdown-Question/m-p/498082#M32605</link>
      <description>&lt;P&gt;Hi, @petersmiddy,&lt;BR /&gt;
If you could put your code in the Code Sample (the button with 101010) I could help you to analyze the regexes, that I cannot correctly read now.&lt;BR /&gt;
Then I see the comma in the token, what it means?&lt;/P&gt;

&lt;P&gt;If you could share a sample of your data and of the search of the dropdown, I could help you with them.&lt;/P&gt;

&lt;P&gt;Then, to use quotes with a token you have to put the full token (with $) inside quotes &lt;CODE&gt;user="$fields,0$"&lt;/CODE&gt;, as you did in the first  bolded case but not in the second: Splunk recognize the token by the "$" chars.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 07:38:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Dropdown-Question/m-p/498082#M32605</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-03-20T07:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Dropdown Question</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Dropdown-Question/m-p/498083#M32606</link>
      <description>&lt;P&gt;@gcusello , thank you!  &lt;/P&gt;

&lt;P&gt;Here is the search code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pcf_* cf_org_name="Network Software Development and Automation" cf_space_name="Development" cf_app_name=*privatecloud-dev* msg=*VALUES* *user_logs*
| rex field=msg "VALUES (?&amp;lt;valuees&amp;gt;.*)"
| eval fields=split(valuees,"'") | eval user=mvindex(fields,0) 
| eval user=mvindex(fields,1)
| eval method=mvindex(fields,3) 
| eval page=mvindex(fields,5) 
| eval params=mvindex(fields,7) 
| eval datetime =mvindex(fields,9)
| eval created_at=mvindex(fields,11) 
| eval updated_at=mvindex(fields,13) 
| stats count by datetime user method page params
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm pulling the data from within the field called 'msg' (example below).  I extract it to new fields so we can search and sort by that data. &lt;/P&gt;

&lt;P&gt;Particulary this data:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;user_logs&lt;/CODE&gt; (&lt;CODE&gt;user&lt;/CODE&gt;, &lt;CODE&gt;method&lt;/CODE&gt;, &lt;CODE&gt;page&lt;/CODE&gt;, &lt;CODE&gt;params&lt;/CODE&gt;, &lt;CODE&gt;datetime&lt;/CODE&gt;, &lt;CODE&gt;created_at&lt;/CODE&gt;, &lt;CODE&gt;updated_at&lt;/CODE&gt;)&lt;/P&gt;

&lt;P&gt;Here is an example of 'msg':&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;#27;[1m&amp;#27;[36mUserLog Create (27.8ms)&amp;#27;[0m  &amp;#27;[1m&amp;#27;[32mINSERT INTO `user_logs` (`user`, `method`, `page`, `params`, `datetime`, `created_at`, `updated_at`) VALUES ('Opredelennov, Eugene', 'destroy', 'deployments', '{\"id\"=&amp;gt;132, \"apic_id\"=&amp;gt;1, \"decommission_standard_change_id\"=&amp;gt;\"CRQ000001518730\", \"decommission_standard_change_url\"=&amp;gt;\"https://remedy-test.lmig.com/arsys/shared/Ticket.jsp?ID=CRQ000001518730\", \"decommissioner_id\"=&amp;gt;2, \"name\"=&amp;gt;\"10G-VPC-test-vlan2508\", \"description\"=&amp;gt;\"10G-VPC-test-vlan2508\", \"provision_standard_change_id\"=&amp;gt;\"CRQ000001517986\", \"provision_standard_change_url\"=&amp;gt;\"https://remedy-test.lmig.com/arsys/shared/Ticket.jsp?ID=CRQ000001517986\", \"status\"=&amp;gt;\"Decommissioned\", \"user_id\"=&amp;gt;4, \"user_group_id\"=&amp;gt;nil}', '2020-03-16 14:50:42', '2020-03-16 14:50:42', '2020-03-16 14:50:42')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Mar 2020 12:37:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Dropdown-Question/m-p/498083#M32606</guid>
      <dc:creator>petersmiddy</dc:creator>
      <dc:date>2020-03-20T12:37:50Z</dc:date>
    </item>
  </channel>
</rss>

