<?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 am I not able to get any dynamic content using the collect command with the marker option? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110105#M1114</link>
    <description>&lt;P&gt;I eventually made it work. I read the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Collect" target="_blank"&gt;docs&lt;/A&gt; and there it states:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;marker
Syntax: marker=&amp;lt;string&amp;gt;
Description: A string, usually of key-value pairs, to append to each event written out. Optional, default is empty.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since this is not working with dynamic content (e.g. field content), I will either table my dynamic marker field before &lt;CODE&gt;collect&lt;/CODE&gt;:&lt;BR /&gt;
&lt;CODE&gt;index=_internal file=* | head 10 | eval myMarker="some usefull stuff" | table _time file myMarker | collect  index=test_temp&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;or append my marker string to to the content field &lt;CODE&gt;_raw&lt;/CODE&gt; beginning with &lt;CODE&gt;, &lt;/CODE&gt;:&lt;BR /&gt;
&lt;CODE&gt;index=_internal | head 10 | eval _raw=_raw.", myKey = isSearchable, andWill = beExtracted" | collect index=test_temp&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:18:20 GMT</pubDate>
    <dc:creator>bjoernjensen</dc:creator>
    <dc:date>2020-09-28T19:18:20Z</dc:date>
    <item>
      <title>Why am I not able to get any dynamic content using the collect command with the marker option?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110103#M1112</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;I am trying to use &lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Collect"&gt;collect&lt;/A&gt;&lt;/CODE&gt; together with the &lt;CODE&gt;marker&lt;/CODE&gt;-Option. Unfortunately I am not able to get any dynamic content for the marker string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal file=* | head 10 | table _time file | collect  index=test_temp marker=file
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;yields into &lt;CODE&gt;_raw&lt;/CODE&gt; entries like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;03/26/2015 23:59:27 +0100, info_search_time=1427410768.113, file=shelper, file
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I would like of course is the content of the field file and not the string &lt;CODE&gt;file&lt;/CODE&gt;. I have already tried:&lt;BR /&gt;
&lt;CODE&gt;... marker='file'&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;... marker=\'file\'&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;... marker=\\'file\\'&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;... marker=\\\'file\\\'&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But the marker is always set to the string.&lt;/P&gt;

&lt;P&gt;I thought of using &lt;CODE&gt;map&lt;/CODE&gt;-command. But this is very ugly since map starts a search for each event going into map (&lt;CODE&gt;maxsearches&lt;/CODE&gt; could be adjusted, but .... naah)&lt;/P&gt;

&lt;P&gt;I also tried to create a macro &lt;CODE&gt;mycollect(2)&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;collect index=$index$ marker=$marker$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the same result for either&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal file=* | head 10 | table _time file | `mycollect(temp_test,file)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal file=* | head 10 | table _time file | `mycollect(temp_test,'file')`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, has anyone an idea?&lt;BR /&gt;
Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2015 23:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110103#M1112</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2015-03-26T23:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to get any dynamic content using the collect command with the marker option?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110104#M1113</link>
      <description>&lt;P&gt;I'm having the same issue, I get no error in the search but the data is never indexed if I use a field value instead of just text.  &lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2015 01:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110104#M1113</guid>
      <dc:creator>packman</dc:creator>
      <dc:date>2015-03-27T01:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to get any dynamic content using the collect command with the marker option?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110105#M1114</link>
      <description>&lt;P&gt;I eventually made it work. I read the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Collect" target="_blank"&gt;docs&lt;/A&gt; and there it states:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;marker
Syntax: marker=&amp;lt;string&amp;gt;
Description: A string, usually of key-value pairs, to append to each event written out. Optional, default is empty.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since this is not working with dynamic content (e.g. field content), I will either table my dynamic marker field before &lt;CODE&gt;collect&lt;/CODE&gt;:&lt;BR /&gt;
&lt;CODE&gt;index=_internal file=* | head 10 | eval myMarker="some usefull stuff" | table _time file myMarker | collect  index=test_temp&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;or append my marker string to to the content field &lt;CODE&gt;_raw&lt;/CODE&gt; beginning with &lt;CODE&gt;, &lt;/CODE&gt;:&lt;BR /&gt;
&lt;CODE&gt;index=_internal | head 10 | eval _raw=_raw.", myKey = isSearchable, andWill = beExtracted" | collect index=test_temp&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:18:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110105#M1114</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2020-09-28T19:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I not able to get any dynamic content using the collect command with the marker option?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110106#M1115</link>
      <description>&lt;P&gt;Right, defining it as a field using an eval is the way to go for your use case. As you saw in the docs, marker has to be a string, which is useful for separating out different sets of data in the summary index.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| collect index="mysummaryindex" marker="report=top_sales"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Allows me to search on that data using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=mysummaryindex report=top_sales
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Mar 2015 23:33:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-am-I-not-able-to-get-any-dynamic-content-using-the-collect/m-p/110106#M1115</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-03-27T23:33:02Z</dc:date>
    </item>
  </channel>
</rss>

