<?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: Why is the collect command not working when used with map command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266880#M80275</link>
    <description>&lt;P&gt;The quotes in delims=" " may need to be escaped.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Feb 2017 21:58:35 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-02-01T21:58:35Z</dc:date>
    <item>
      <title>Why is the collect command not working when used with map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266879#M80274</link>
      <description>&lt;P&gt;If I do this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=log NOT "*INFO*" earliest=-40d@d latest=-39d@d 
 | cluster t=0.3 field=raw showcount=t labelonly=false delims=" "
 | eval old_label=cluster_label 
 | eventstats sum(cluster_count) as total_events 
 | eval Freq_Baseline=cluster_count/total_events 
 | fields _time, raw, old_label, cluster_count, Freq_Baseline, total_events 
 | collect index=clusters
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Everything gets collected in index=clusters&lt;/P&gt;

&lt;P&gt;BUT if I include this in a map,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=is_log | head 1 
| streamstats count as latest 
| eval latest = 40
| eval earliest=latest + 1
| eval earliest= tostring(-earliest) + "d@d"  
| eval latest= tostring(-latest) + "d@d" 
| map maxsearches=35 search="search index=is_log NOT "*INFO*" earliest=$earliest$ latest=$latest$ 
 | cluster t=0.3 field=raw showcount=t labelonly=false delims=" "
 | eval old_label=cluster_label 
 | eventstats sum(cluster_count) as total_events 
 | eval Freq_Baseline=cluster_count/total_events 
 | fields _time, raw, old_label, cluster_count, Freq_Baseline, total_events 
 | collect index=clusters"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then nothing is collected in the index, although the same results show up on the screen&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 15:21:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266879#M80274</guid>
      <dc:creator>TiagoTLD1</dc:creator>
      <dc:date>2017-02-01T15:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the collect command not working when used with map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266880#M80275</link>
      <description>&lt;P&gt;The quotes in delims=" " may need to be escaped.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2017 21:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266880#M80275</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-01T21:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the collect command not working when used with map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266881#M80276</link>
      <description>&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 10:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266881#M80276</guid>
      <dc:creator>TiagoTLD1</dc:creator>
      <dc:date>2017-02-02T10:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the collect command not working when used with map command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266882#M80277</link>
      <description>&lt;P&gt;The above command was really helpful so what if want to move source of data to other index without changing values to stash.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 00:02:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-collect-command-not-working-when-used-with-map/m-p/266882#M80277</guid>
      <dc:creator>rvanteru</dc:creator>
      <dc:date>2017-05-10T00:02:54Z</dc:date>
    </item>
  </channel>
</rss>

