<?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 pass a value extracted from a main search to a sub search from different source? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-value-extracted-from-a-main-search-to-a-sub-search/m-p/443925#M125905</link>
    <description>&lt;P&gt;Hi @vivek991985 &lt;BR /&gt;
You can't pass a value from a main search to a sub search, it works the other way round.&lt;BR /&gt;
That being said and from what I can understand  try something like this - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source ="FILE2.log"  | eval id=[search  source="FILE1.log" search_input | rex ".*]*Rpc id :(?[0-9][0-9][0-9][0-9][0-9][0-9])" |return $rpc_id]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, the eval gets executed first and whatever rex you are performing (assuming the rex works) gets assigned o the field id, you can then pipe on and do what you need with file2log source&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2019 16:24:59 GMT</pubDate>
    <dc:creator>Sukisen1981</dc:creator>
    <dc:date>2019-08-12T16:24:59Z</dc:date>
    <item>
      <title>How to pass a value extracted from a main search to a sub search from different source?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-value-extracted-from-a-main-search-to-a-sub-search/m-p/443924#M125904</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="FILE1.log" search_input | rex ".*]*Rpc id :(?[0-9][0-9][0-9][0-9][0-9][0-9])" | append [search source ="FILE2.log" rpc_id]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 14:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-value-extracted-from-a-main-search-to-a-sub-search/m-p/443924#M125904</guid>
      <dc:creator>vivek991985</dc:creator>
      <dc:date>2019-08-12T14:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a value extracted from a main search to a sub search from different source?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-value-extracted-from-a-main-search-to-a-sub-search/m-p/443925#M125905</link>
      <description>&lt;P&gt;Hi @vivek991985 &lt;BR /&gt;
You can't pass a value from a main search to a sub search, it works the other way round.&lt;BR /&gt;
That being said and from what I can understand  try something like this - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source ="FILE2.log"  | eval id=[search  source="FILE1.log" search_input | rex ".*]*Rpc id :(?[0-9][0-9][0-9][0-9][0-9][0-9])" |return $rpc_id]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Basically, the eval gets executed first and whatever rex you are performing (assuming the rex works) gets assigned o the field id, you can then pipe on and do what you need with file2log source&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 16:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-value-extracted-from-a-main-search-to-a-sub-search/m-p/443925#M125905</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-08-12T16:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a value extracted from a main search to a sub search from different source?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-value-extracted-from-a-main-search-to-a-sub-search/m-p/443926#M125906</link>
      <description>&lt;P&gt;Thank you @Sukisen1981 &lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 17:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-pass-a-value-extracted-from-a-main-search-to-a-sub-search/m-p/443926#M125906</guid>
      <dc:creator>vivek991985</dc:creator>
      <dc:date>2019-08-12T17:33:03Z</dc:date>
    </item>
  </channel>
</rss>

