<?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 MAP command in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317496#M94968</link>
    <description>&lt;P&gt;Hi Team, I am having a difficulty in understanding map command. In the below commands, we need to extract work order ID from one sourcetype and using that, I need to extract sessionid corresponding to that work order ID. &lt;/P&gt;

&lt;P&gt;sourcetype=XYZ QI-*|rex "FINISH:\sWO\sID\sis\s\s(?[^\s]+)"|stats values(WOID) as WOID|map search="search sourcetype=ABC val=$WOID$|stats values(sessionid)" &lt;/P&gt;

&lt;P&gt;When I just using one Work order (QI-12345) I am getting the result. But when I am using QI-* (which  has 6 such work order ID) , I am not able to get results. Could you please help? &lt;/P&gt;

&lt;P&gt;Thanks ,&lt;BR /&gt;
Arjit. &lt;/P&gt;</description>
    <pubDate>Thu, 25 May 2017 05:56:52 GMT</pubDate>
    <dc:creator>arjitgoswami</dc:creator>
    <dc:date>2017-05-25T05:56:52Z</dc:date>
    <item>
      <title>MAP command in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317496#M94968</link>
      <description>&lt;P&gt;Hi Team, I am having a difficulty in understanding map command. In the below commands, we need to extract work order ID from one sourcetype and using that, I need to extract sessionid corresponding to that work order ID. &lt;/P&gt;

&lt;P&gt;sourcetype=XYZ QI-*|rex "FINISH:\sWO\sID\sis\s\s(?[^\s]+)"|stats values(WOID) as WOID|map search="search sourcetype=ABC val=$WOID$|stats values(sessionid)" &lt;/P&gt;

&lt;P&gt;When I just using one Work order (QI-12345) I am getting the result. But when I am using QI-* (which  has 6 such work order ID) , I am not able to get results. Could you please help? &lt;/P&gt;

&lt;P&gt;Thanks ,&lt;BR /&gt;
Arjit. &lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2017 05:56:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317496#M94968</guid>
      <dc:creator>arjitgoswami</dc:creator>
      <dc:date>2017-05-25T05:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: MAP command in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317497#M94969</link>
      <description>&lt;P&gt;You have to pass values one by one to the map search command. Try something like this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=pega17052017n QI-*|rex "UWCChange\sStage\sFINISH:\sWO\sID\sis\s\s(?[^\s]+)"|dedup WOID | table WOID |map search="search sourcetype=QI-535653 val=$WOID$|stats values(sessionid) "
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 06:41:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317497#M94969</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-05-25T06:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: MAP command in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317498#M94970</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="pega17052017n" QI-535653 OR QI-535654|stats values(WOID) as val
| table val
| map maxsearches=10 search="search sourcetype=\"QI-535653\" QI-* val=$val$|stats values(sessionid) by val"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 12:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317498#M94970</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-25T12:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: MAP command in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317499#M94971</link>
      <description>&lt;P&gt;Thanks  @niketnilay ! adding stats count by WOID helped to send single valued result to map command. It looks like only count function (and not stats(values) or table command) is sending single values data to map command &lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 08:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317499#M94971</guid>
      <dc:creator>arjitgoswami</dc:creator>
      <dc:date>2017-05-26T08:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: MAP command in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317500#M94972</link>
      <description>&lt;P&gt;@arjitgoswami, you r base search is returning multi-value result. Try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype="pega17052017n" QI-535653 OR QI-535654
 | stats count by WOID
 | rename WOID as val
 | table val
 | map search="search sourcetype=\"QI-535653\" QI-* val=$val$
                           | stats values(sessionid) by val" maxsearches=10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 May 2017 08:44:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317500#M94972</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-26T08:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: MAP command in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317501#M94973</link>
      <description>&lt;P&gt;Hi @arjitgoswamy, since it was a duplicate thread (&lt;A href="https://answers.splunk.com/answers/542641/map-command-in-splunk.html"&gt;https://answers.splunk.com/answers/542641/map-command-in-splunk.html&lt;/A&gt;),  where I had answered your question, I have pasted my comment here as an answer. Please accept to mark this as closed.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 08:46:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/MAP-command-in-splunk/m-p/317501#M94973</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-26T08:46:19Z</dc:date>
    </item>
  </channel>
</rss>

