<?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: How to check a certain (not _raw) field value matches a value returned by a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169635#M48479</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch [mysubsearch|fields host|eval host="host=".host | return $$host]

OR 

mysearch [mysubsearch|fields host|eval search="host=".host | table search]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch [mysubsearch|table host | format ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 04 Aug 2014 16:20:47 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-08-04T16:20:47Z</dc:date>
    <item>
      <title>How to check a certain (not _raw) field value matches a value returned by a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169634#M48478</link>
      <description>&lt;P&gt;By default, when we append a subsearch to a search, it looks for events which _raw field value matches one of the value returned by the subsearch.&lt;/P&gt;

&lt;P&gt;Is there a way to check that a certain field value (not _raw like above) matches one of the values returned by the subsearch?&lt;/P&gt;

&lt;P&gt;I tried the below, by appending host= to my subsearch results, to force searching on the field host, and nothing else, but it didn't work.&lt;/P&gt;

&lt;P&gt;mysearch [mysubsearch|fields host|eval host="host=".host]&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 16:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169634#M48478</guid>
      <dc:creator>manus</dc:creator>
      <dc:date>2014-08-04T16:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to check a certain (not _raw) field value matches a value returned by a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169635#M48479</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch [mysubsearch|fields host|eval host="host=".host | return $$host]

OR 

mysearch [mysubsearch|fields host|eval search="host=".host | table search]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch [mysubsearch|table host | format ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Aug 2014 16:20:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169635#M48479</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-04T16:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to check a certain (not _raw) field value matches a value returned by a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169636#M48480</link>
      <description>&lt;P&gt;None of these solutions work.&lt;BR /&gt;
No clue what the first one does, plenty of events from wrong hosts are returned in the end.&lt;/P&gt;

&lt;P&gt;The second one is very close to my first attempt, but like it, doesn't work. The subsearch produces the output anticipated, but the main one is missing the events from many hosts which should have been included.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 17:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169636#M48480</guid>
      <dc:creator>manus</dc:creator>
      <dc:date>2014-08-04T17:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to check a certain (not _raw) field value matches a value returned by a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169637#M48481</link>
      <description>&lt;P&gt;I found a solution... which seems unefficient, but works:&lt;BR /&gt;
mysearch |join host [mysubsearch|fields host]&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 17:17:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169637#M48481</guid>
      <dc:creator>manus</dc:creator>
      <dc:date>2014-08-04T17:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to check a certain (not _raw) field value matches a value returned by a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169638#M48482</link>
      <description>&lt;P&gt;But thanks for help!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 17:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169638#M48482</guid>
      <dc:creator>manus</dc:creator>
      <dc:date>2014-08-04T17:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to check a certain (not _raw) field value matches a value returned by a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169639#M48483</link>
      <description>&lt;P&gt;I might overlooked the scenario where there will be multiple hosts. You can give the updated answer a try (will be faster than join)&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 17:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169639#M48483</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-08-04T17:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to check a certain (not _raw) field value matches a value returned by a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169640#M48484</link>
      <description>&lt;P&gt;Either&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch [ mysubsearch | return 10000 host ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or in this particular case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch [ mysubsearch | fields host ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;are the shortest and simplest. You don't need &lt;CODE&gt;table&lt;/CODE&gt; or &lt;CODE&gt;field&lt;/CODE&gt; with &lt;CODE&gt;return&lt;/CODE&gt;. You don't need &lt;CODE&gt;format&lt;/CODE&gt; because it's implicitly done at the end of a subsearch. You use 10,000 to set the max number of values to be considered. (The default is 1, only the first host will be considered.) In your original question, you didn't mention that you might have mutiple values.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 20:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-a-certain-not-raw-field-value-matches-a-value/m-p/169640#M48484</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2014-08-04T20:48:16Z</dc:date>
    </item>
  </channel>
</rss>

