<?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: Working with two filters for one event row in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157871#M31980</link>
    <description>&lt;P&gt;You can use the &lt;DEFAULT&gt; value as "*" for the dropdown/text box so that if User doesn't selects a filter, its default value * will be supplied.&lt;/DEFAULT&gt;&lt;/P&gt;

&lt;P&gt;E.g. dashboard &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;DynamicChartTitle&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;NULL&amp;lt;/description&amp;gt;
  &amp;lt;fieldset autoRun="true"&amp;gt;
    &amp;lt;input type="dropdown" token="sourcetype" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Sourcetype&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;populatingSearch fieldForValue="sourcetype" fieldForLabel="sourcetype"&amp;gt;
        &amp;lt;![CDATA[index=_internal earliest=-1h@h | stats count by sourcetype | table sourcetype ]]&amp;gt;
      &amp;lt;/populatingSearch&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="source" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Source&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;table&amp;gt;
      &amp;lt;title&amp;gt;The chart tile&amp;lt;/title&amp;gt;
      &amp;lt;searchString&amp;gt;index=_internal [|gentimes start=-1 
        | eval search=if("$sourcetype$"="*","","sourcetype=\"$sourcetype$\"")
        | eval search=case("$source$"="*",search, search !="",search." OR source=\"$source$\"",1=1,"source=\"$source$\"") | table search]
        | stats count by sourcetype, source&amp;lt;/searchString&amp;gt;
      &amp;lt;earliestTime&amp;gt;-1h&amp;lt;/earliestTime&amp;gt;
      &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;            
    &amp;lt;/table&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 28 Jul 2014 12:56:19 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-07-28T12:56:19Z</dc:date>
    <item>
      <title>Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157866#M31975</link>
      <description>&lt;P&gt;I have one drop down and one text input, I need the user to be able to by both components OR INDIVIDUAL, one optional and they are both used for just one event row...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main source type=main_error ChannelCode=$channel$ OR ProcessCode=$process$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone explain this search string to me ?&lt;BR /&gt;
Thanks in advance! &lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2014 13:30:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157866#M31975</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-07-25T13:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157867#M31976</link>
      <description>&lt;P&gt;It's only searching both mandatory :X&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2014 16:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157867#M31976</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-07-25T16:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157868#M31977</link>
      <description>&lt;P&gt;Sorry when I said filter, I meant two inputs...&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2014 18:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157868#M31977</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-07-25T18:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157869#M31978</link>
      <description>&lt;P&gt;Do you mean "both the fields to be mandatory". In you search with that OR condition, even if user gives any one input the search will execute.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2014 19:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157869#M31978</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-07-25T19:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157870#M31979</link>
      <description>&lt;P&gt;When searching using a searchString, it's only searching if user choose a dropdown value and also type something in the text input, and I wanted to be able to search individually independent.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jul 2014 23:22:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157870#M31979</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-07-26T23:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157871#M31980</link>
      <description>&lt;P&gt;You can use the &lt;DEFAULT&gt; value as "*" for the dropdown/text box so that if User doesn't selects a filter, its default value * will be supplied.&lt;/DEFAULT&gt;&lt;/P&gt;

&lt;P&gt;E.g. dashboard &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;DynamicChartTitle&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;NULL&amp;lt;/description&amp;gt;
  &amp;lt;fieldset autoRun="true"&amp;gt;
    &amp;lt;input type="dropdown" token="sourcetype" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;Sourcetype&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;populatingSearch fieldForValue="sourcetype" fieldForLabel="sourcetype"&amp;gt;
        &amp;lt;![CDATA[index=_internal earliest=-1h@h | stats count by sourcetype | table sourcetype ]]&amp;gt;
      &amp;lt;/populatingSearch&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="source" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Source&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;table&amp;gt;
      &amp;lt;title&amp;gt;The chart tile&amp;lt;/title&amp;gt;
      &amp;lt;searchString&amp;gt;index=_internal [|gentimes start=-1 
        | eval search=if("$sourcetype$"="*","","sourcetype=\"$sourcetype$\"")
        | eval search=case("$source$"="*",search, search !="",search." OR source=\"$source$\"",1=1,"source=\"$source$\"") | table search]
        | stats count by sourcetype, source&amp;lt;/searchString&amp;gt;
      &amp;lt;earliestTime&amp;gt;-1h&amp;lt;/earliestTime&amp;gt;
      &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;            
    &amp;lt;/table&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jul 2014 12:56:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157871#M31980</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-28T12:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157872#M31981</link>
      <description>&lt;P&gt;This is a good approach in general for the mentioned problem. But can't there be some side effects in this special case? Because the fields are combined with the OR operator.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 13:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157872#M31981</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2014-07-28T13:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Working with two filters for one event row</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157873#M31982</link>
      <description>&lt;P&gt;I had overlooked the OR condition between two filters. I have added some logic to handle that situation. Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 14:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Working-with-two-filters-for-one-event-row/m-p/157873#M31982</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-28T14:28:42Z</dc:date>
    </item>
  </channel>
</rss>

