<?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: Add search field based on value of another field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452110#M172325</link>
    <description>&lt;P&gt;This solution somewhat works.  When I change values, the new search field doesn't change.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2019 12:19:23 GMT</pubDate>
    <dc:creator>jsoderling</dc:creator>
    <dc:date>2019-03-25T12:19:23Z</dc:date>
    <item>
      <title>Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452106#M172321</link>
      <description>&lt;P&gt;I have a dashboard panel with a radio input.  If the user choose Selection A (4624), I need to add a field to the search.   I've tried using eval with if in the search to add the new field, but it either errors out or never processes.   Thanks.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;input type="radio" token="priv_login" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Login Status&amp;lt;/label&amp;gt;
      &amp;lt;choice value="4624"&amp;gt;Successful&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="4625"&amp;gt;Failed&amp;lt;/choice&amp;gt;
      &amp;lt;initialValue&amp;gt;4624&amp;lt;/initialValue&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition&amp;gt;
          &amp;lt;set token="panellabel"&amp;gt;$label$&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single&amp;gt;
        &amp;lt;title&amp;gt;$panellabel$ Privileged Account Logins&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=con_wineventlog_security src="gord*" (Account_Name="*.SA" OR Account_Name="*.*.WA") EventCode=$priv_login$ | stats count(EventCode)&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$priv_agg_tok.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$priv_agg_tok.latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
          &amp;lt;refresh&amp;gt;60m&amp;lt;/refresh&amp;gt;
          &amp;lt;refreshType&amp;gt;delay&amp;lt;/refreshType&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
    &amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:50:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452106#M172321</guid>
      <dc:creator>jsoderling</dc:creator>
      <dc:date>2019-03-21T15:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452107#M172322</link>
      <description>&lt;P&gt;You can modify you input like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;         &amp;lt;input type="radio" token="priv_login" searchWhenChanged="true"&amp;gt;
           &amp;lt;label&amp;gt;Login Status&amp;lt;/label&amp;gt;
           &amp;lt;choice value="4624"&amp;gt;Successful&amp;lt;/choice&amp;gt;
           &amp;lt;choice value="4625"&amp;gt;Failed&amp;lt;/choice&amp;gt;
           &amp;lt;initialValue&amp;gt;4624&amp;lt;/initialValue&amp;gt;
           &amp;lt;change&amp;gt;
             &amp;lt;set token="panellabel"&amp;gt;$label$&amp;lt;/set&amp;gt;
             &amp;lt;condition value="4624"&amp;gt;
               &amp;lt;set token="additional_search"&amp;gt;yoursecondfield=something&amp;lt;/set&amp;gt;
             &amp;lt;/condition&amp;gt;
           &amp;lt;/change&amp;gt;
         &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can include &lt;CODE&gt;$additional_search$&lt;/CODE&gt; in your search query&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 16:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452107#M172322</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-03-21T16:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452108#M172323</link>
      <description>&lt;P&gt;Thank you.  This solution works as long, but I need to use "!=" with my new search field.  The token is dropping the "!".  &lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 17:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452108#M172323</guid>
      <dc:creator>jsoderling</dc:creator>
      <dc:date>2019-03-21T17:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452109#M172324</link>
      <description>&lt;P&gt;In that case, try using &lt;CODE&gt;$tokenname|s$&lt;/CODE&gt; to enable search encoding of token.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 17:06:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452109#M172324</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-03-21T17:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452110#M172325</link>
      <description>&lt;P&gt;This solution somewhat works.  When I change values, the new search field doesn't change.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:19:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452110#M172325</guid>
      <dc:creator>jsoderling</dc:creator>
      <dc:date>2019-03-25T12:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452111#M172326</link>
      <description>&lt;P&gt;Okay, in that case you need to add a  after &lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 13:58:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452111#M172326</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-03-25T13:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452112#M172327</link>
      <description>&lt;P&gt;I think your comment didn't fully update.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 14:25:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452112#M172327</guid>
      <dc:creator>jsoderling</dc:creator>
      <dc:date>2019-03-25T14:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add search field based on value of another field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452113#M172328</link>
      <description>&lt;P&gt;I was never able to pass a new field to the query using a separate token.  Splunk was always waiting for data input.  I solved the issue by using the radio button's  statement to add the field (Logon_ID).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;input type="radio" searchWhenChanged="true" token="priv_login_tok"&amp;gt;
      &amp;lt;label&amp;gt;Login Status&amp;lt;/label&amp;gt;
      &amp;lt;choice value="4624 Logon_ID!=0x0"&amp;gt;Successful&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="4625"&amp;gt;Failed&amp;lt;/choice&amp;gt;
      &amp;lt;initialValue&amp;gt;4624&amp;lt;/initialValue&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Mar 2019 13:17:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-search-field-based-on-value-of-another-field/m-p/452113#M172328</guid>
      <dc:creator>jsoderling</dc:creator>
      <dc:date>2019-03-26T13:17:04Z</dc:date>
    </item>
  </channel>
</rss>

