<?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: Subsearch return multiple fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-return-multiple-fields/m-p/501610#M139650</link>
    <description>&lt;P&gt;If index2_time field is part of index1 then check with format. If not, replace field name index2_time with timestamp field in index1 which contains _time values.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 earliest=-5h@h latest=-1h@h dst=* [ search index=index2 earliest=-15m latest=now() dest=* | head 1 | eval index2_time=_time | fields dest, index2_time | format ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Sep 2020 04:44:03 GMT</pubDate>
    <dc:creator>manjunathmeti</dc:creator>
    <dc:date>2020-09-30T04:44:03Z</dc:date>
    <item>
      <title>Subsearch return multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-return-multiple-fields/m-p/501609#M139649</link>
      <description>&lt;P&gt;Hi and thank you in advance.  I've simplified the problem for brevity sake.&lt;/P&gt;

&lt;P&gt;I'm trying to return multiple fields by way of using a subsearch. Looking for a recent match in index2 where there was an older event occurring in index1.  &lt;/P&gt;

&lt;P&gt;An example would be detecting an attack with previous reconnaissance.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 earliest=-5h@h latest=-1h@h dst=* [search index=index2 earliest=-15m latest=now() dest=* | head 1 | eval index2_time=_time | return dst=dest ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works, for finding a match. However, I want to pass up the _time of the more recent event in index2 (index2_time) and that doesn't appear to populate.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:44:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-return-multiple-fields/m-p/501609#M139649</guid>
      <dc:creator>antb</dc:creator>
      <dc:date>2020-09-30T04:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch return multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-return-multiple-fields/m-p/501610#M139650</link>
      <description>&lt;P&gt;If index2_time field is part of index1 then check with format. If not, replace field name index2_time with timestamp field in index1 which contains _time values.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=index1 earliest=-5h@h latest=-1h@h dst=* [ search index=index2 earliest=-15m latest=now() dest=* | head 1 | eval index2_time=_time | fields dest, index2_time | format ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-return-multiple-fields/m-p/501610#M139650</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-09-30T04:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch return multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch-return-multiple-fields/m-p/501611#M139651</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;, I reviewed this response (and waited to see if there were others) but not sure I understand. index2_time is just the example I'm using where I bubble up the _time - I could have chose any field. The assignment to index2_time isn't being populated as I can only return a single field.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch-return-multiple-fields/m-p/501611#M139651</guid>
      <dc:creator>antb</dc:creator>
      <dc:date>2020-09-30T04:53:40Z</dc:date>
    </item>
  </channel>
</rss>

