<?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: Get main search resulting events in the output when using map command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139882#M38509</link>
    <description>&lt;P&gt;Use join option "type=left" to get unmatched requests.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Apr 2014 14:47:42 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-04-24T14:47:42Z</dc:date>
    <item>
      <title>Get main search resulting events in the output when using map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139876#M38503</link>
      <description>&lt;P&gt;I have the following search pipeline&lt;/P&gt;

&lt;P&gt;search field1=xxxx | map search="search field2=yyyy field3=$file2$"&lt;/P&gt;

&lt;P&gt;When I run it I only get as output the results from "search field2=yyyy field3=$file2$" for each result in the main search. Is it somehow possible to get in the output the events resulting from  "search field1=xxxx" too without having to append them like this?&lt;/P&gt;

&lt;P&gt;search field1=xxxx | map search="search field2=yyyy field3=$file2$" | append [ search field1=xxxx ]&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2014 10:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139876#M38503</guid>
      <dc:creator>mevcloud</dc:creator>
      <dc:date>2014-04-23T10:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get main search resulting events in the output when using map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139877#M38504</link>
      <description>&lt;P&gt;What's your use case?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2014 13:54:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139877#M38504</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-23T13:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get main search resulting events in the output when using map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139878#M38505</link>
      <description>&lt;P&gt;My use case is the following one: I have to find a request and its matching response. Both the request and the response are xml messages. The response has an element called "MessageID" that contains a value that matches the value of another element called "RelatesTo" in the response. In the main search I look for the particular request I am looking for and extract the MessageID value using the rex command. I then using that $messageId$ in the map search to find the response. The problem is that using that I only get the response in the output and not the request.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2014 08:59:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139878#M38505</guid>
      <dc:creator>mevcloud</dc:creator>
      <dc:date>2014-04-24T08:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get main search resulting events in the output when using map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139879#M38506</link>
      <description>&lt;P&gt;I see... the most intuitive way would be to either use &lt;CODE&gt;join&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search for requests | do some extracting to get a field called MessageID | join MessageID [search for responses | do some extracting to get a field called MessageID]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or to use &lt;CODE&gt;transaction&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search for requests OR responses | do some extracting on each to get a field called MessageID in both types of events | transaction MessageID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Depending on your reporting after that, you may also be able to use &lt;CODE&gt;stats&lt;/CODE&gt; instead of &lt;CODE&gt;transaction&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search for requests OR responses | do some extracting on each to get a field called MessageID in both types of events | stats some(reporting) as stuff by MessageID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Apr 2014 10:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139879#M38506</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-24T10:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get main search resulting events in the output when using map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139880#M38507</link>
      <description>&lt;P&gt;I had already tried the join exactly they way you mentioned in the answer and using it I am only getting the events on the left size (request) when there is a match and not both, as I would have expect from the description of the command.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2014 12:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139880#M38507</guid>
      <dc:creator>mevcloud</dc:creator>
      <dc:date>2014-04-24T12:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Get main search resulting events in the output when using map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139881#M38508</link>
      <description>&lt;P&gt;You are getting fields from both sources. Don't use the event viewer tab to judge whether a join was successful, rather append a &lt;CODE&gt;table field1 field2 ...&lt;/CODE&gt; and see if you're getting fields from both sources.&lt;/P&gt;

&lt;P&gt;The raw text of an event is just another field (&lt;CODE&gt;_raw&lt;/CODE&gt;), so its behaviour after a join may not be as intuitively expected.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2014 13:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139881#M38508</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-24T13:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get main search resulting events in the output when using map command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139882#M38509</link>
      <description>&lt;P&gt;Use join option "type=left" to get unmatched requests.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2014 14:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-main-search-resulting-events-in-the-output-when-using-map/m-p/139882#M38509</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-04-24T14:47:42Z</dc:date>
    </item>
  </channel>
</rss>

