<?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: What is the query to update table of a panel with values chosen from a dropdown? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293825#M88712</link>
    <description>&lt;P&gt;Hi @kamlesh_vagela  and @cusello&lt;/P&gt;

&lt;P&gt;I had  to tweak the query to add a where clause instead of search   | where 'Course_name' == dp &lt;BR /&gt;
and == for field comparison and now its working as expected. &lt;/P&gt;

&lt;P&gt;But when for the condition where i have to get all rows am not getting that &lt;BR /&gt;
I added selected=All and tried to assign * to it which is not returning any result. &lt;/P&gt;

&lt;P&gt;| eval dp=case(selected=="Q1","H1 2017", selected=="Q2","H2 2017", selected=="All","*",1=1,0) &lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2018 13:06:11 GMT</pubDate>
    <dc:creator>surekhasplunk</dc:creator>
    <dc:date>2018-02-14T13:06:11Z</dc:date>
    <item>
      <title>What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293818#M88705</link>
      <description>&lt;P&gt;I have a drop-down to choose values of quarter.    &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;label&amp;gt;Choose Quarter&amp;lt;/label&amp;gt;
  &amp;lt;choice value="Q"&amp;gt;Quarter&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="Q1"&amp;gt;Q1&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="Q2"&amp;gt;Q2&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="Q3"&amp;gt;Q3&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="Q4"&amp;gt;Q4&amp;lt;/choice&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now if I choose Q2 one of my panels should get populated with all those values from abc.csv file where "Cuorse_Name"=&lt;EM&gt;H1&lt;/EM&gt;&lt;BR /&gt;
and if I choose Q4 then the same panel should get populated with values from the same abc.csv file where "Cuorse_Name"=&lt;EM&gt;H2&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Please help with the query&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:07:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293818#M88705</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2020-09-29T18:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293819#M88706</link>
      <description>&lt;P&gt;Hi surekhasplunk,&lt;BR /&gt;
this is an example for your needs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test1&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="log_level"&amp;gt;
      &amp;lt;label&amp;gt;log_level&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="INFO"&amp;gt;INFO&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="DEBUG"&amp;gt;DEBUG&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="ERROR"&amp;gt;ERROR&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="WARN"&amp;gt;WARN&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="WARNING"&amp;gt;WARNING&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;log_level=&amp;lt;/prefix&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;event&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal $log_level$&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@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="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="list.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="list.wrap"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="maxLines"&amp;gt;5&amp;lt;/option&amp;gt;
        &amp;lt;option name="raw.drilldown"&amp;gt;full&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;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="table.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="table.sortDirection"&amp;gt;asc&amp;lt;/option&amp;gt;
        &amp;lt;option name="table.wrap"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="type"&amp;gt;list&amp;lt;/option&amp;gt;
      &amp;lt;/event&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In few words, in the dropdown you have to insert the values to search, in the prefix tag the field name and in the search the tag using $.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 11:56:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293819#M88706</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-02-14T11:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293820#M88707</link>
      <description>&lt;P&gt;Hi @cusello,&lt;/P&gt;

&lt;P&gt;My dropdown works well for populating other tables in the dashboard where there is a column with value &lt;EM&gt;Q1&lt;/EM&gt; etc. &lt;BR /&gt;
Its problem only when the file doesn't have that data. &lt;BR /&gt;
so we have to manipulate Q1=H1 Q2=H2 Q3=H3 etc. &lt;/P&gt;

&lt;P&gt;|inputlookup abc.csv |eval dp=case('$quarter$'=="Q1","H1", '$quarter$'=="Q2","H2",1=1,0)|search "Course_name"='&lt;EM&gt;$dp$&lt;/EM&gt;' | chart count as field2 over field3 by field4 &lt;/P&gt;

&lt;P&gt;currently i am trying to use this query but not getting proper results $dp$ is not getting the value from case statement. &lt;BR /&gt;
Pls help&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 12:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293820#M88707</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2018-02-14T12:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293821#M88708</link>
      <description>&lt;P&gt;Hi @surekhasplunk, &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup abc.csv 
| eval selected="$quarter$"
| eval dp=case(selected=="Q1","H1", selected=="Q2","H2",1=1,0) 
| search "Course_name"=dp 
| chart count as field2 over field3 by field4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Feb 2018 12:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293821#M88708</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-02-14T12:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293822#M88709</link>
      <description>&lt;P&gt;Let me understand:&lt;BR /&gt;
Do you have a column called &lt;CODE&gt;Cuorse_Name&lt;/CODE&gt; where sometimes there are values Q1, Q2, ... and sometimes H1, H2, ... but the column name is always the same &lt;BR /&gt;
or do you have values Q1, Q2, in a column (e.g. Cuorse_Name1) and H1, H2 in another column (e,g, Cuorse_Name2), &lt;BR /&gt;
which one?&lt;/P&gt;

&lt;P&gt;In the first case you can use eval command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Cuorse_Name=case(Cuorse_Name="H1","Q1",Cuorse_Name="H2","Q2",...)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in the second one, you have to use the same eval command and a coalesce function&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Cuorse_Name=coalesce(Cuorse_Name1,Cuorse_Name2)
| eval Cuorse_Name=case(Cuorse_Name="H1","Q1",Cuorse_Name="H2","Q2",...)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293822#M88709</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T18:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293823#M88710</link>
      <description>&lt;P&gt;Hi @cusello,&lt;/P&gt;

&lt;P&gt;From Dropdown i can select Q1 or Q2 or Q3 or Q4&lt;BR /&gt;&lt;BR /&gt;
In my csv file i have a field called "Course Name" which have values like "H1 2017" "H2 2017" etc.&lt;BR /&gt;
So if i choose Q1 i should search for "Course Name"=&lt;EM&gt;H1&lt;/EM&gt; and show rest of the items from the csv file. &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 12:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293823#M88710</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2018-02-14T12:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293824#M88711</link>
      <description>&lt;P&gt;Hi @kamlesh_vagela,&lt;/P&gt;

&lt;P&gt;I tried your way but i read somewhere eval creates fields and not variables/tokens &lt;BR /&gt;
So here selected and dp two fields are getting created but the command search "Course_name"=dp is not working as expected to match the values of the fields. &lt;BR /&gt;
Though both have got same values its not returning anyting. &lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 12:54:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293824#M88711</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2018-02-14T12:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293825#M88712</link>
      <description>&lt;P&gt;Hi @kamlesh_vagela  and @cusello&lt;/P&gt;

&lt;P&gt;I had  to tweak the query to add a where clause instead of search   | where 'Course_name' == dp &lt;BR /&gt;
and == for field comparison and now its working as expected. &lt;/P&gt;

&lt;P&gt;But when for the condition where i have to get all rows am not getting that &lt;BR /&gt;
I added selected=All and tried to assign * to it which is not returning any result. &lt;/P&gt;

&lt;P&gt;| eval dp=case(selected=="Q1","H1 2017", selected=="Q2","H2 2017", selected=="All","*",1=1,0) &lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 13:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293825#M88712</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2018-02-14T13:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293826#M88713</link>
      <description>&lt;P&gt;Hi @surekhasplunk,&lt;BR /&gt;
put an asterisk in the value&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;choice value="Course_Name=H1*"&amp;gt;Q1&amp;lt;/choice&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or in the search extract the quarter value&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Course_Name=substr(Course_Name,1,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and use it for filter.&lt;BR /&gt;
If you can, don't use spaces in field names (Course Name), if you must, use double quotes ("Course Name")&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 13:17:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293826#M88713</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-02-14T13:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293827#M88714</link>
      <description>&lt;P&gt;Hi @surekhasplunk,&lt;BR /&gt;
If you're satisfied, please accept and/or upvote answer.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 13:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293827#M88714</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-02-14T13:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: What is the query to update table of a panel with values chosen from a dropdown?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293828#M88715</link>
      <description>&lt;P&gt;Great @surekhasplunk,&lt;/P&gt;

&lt;P&gt;Please accept your answer and  Upvote my and  @cusello 's comment on previous post.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
&lt;STRONG&gt;Happy Splunking&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 13:25:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-query-to-update-table-of-a-panel-with-values-chosen/m-p/293828#M88715</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-02-14T13:25:36Z</dc:date>
    </item>
  </channel>
</rss>

