<?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: How to use &amp;quot;collect&amp;quot; and keep the timestamp and field extractions of the event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-collect-quot-and-keep-the-timestamp-and-field/m-p/102458#M26476</link>
    <description>&lt;P&gt;The problem was that the _raw field came from a database and were not prefixed by a timestamp. So what I did in the end was add the following to prepend it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my search | eval _raw=_time + ": " + _raw | collect index=summary
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't have any way of adding the field extractions though that can be done at search time manually.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jul 2013 13:11:35 GMT</pubDate>
    <dc:creator>jameshgibson</dc:creator>
    <dc:date>2013-07-22T13:11:35Z</dc:date>
    <item>
      <title>How to use "collect" and keep the timestamp and field extractions of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-collect-quot-and-keep-the-timestamp-and-field/m-p/102457#M26475</link>
      <description>&lt;P&gt;So I have used collect to save some events into a summary index. The problem is all of the timestamp information is lost which makes the info next to useless. It desides to default all the events to the search time.&lt;/P&gt;

&lt;P&gt;It also drops all the field extractions that I set up which is a pain but can be worked around at a push.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;pseudo search:&lt;/STRONG&gt;  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=x my_field=name | rex=something "do_some_extractions" | collect index=summary
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jul 2013 10:15:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-collect-quot-and-keep-the-timestamp-and-field/m-p/102457#M26475</guid>
      <dc:creator>jameshgibson</dc:creator>
      <dc:date>2013-07-22T10:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "collect" and keep the timestamp and field extractions of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-collect-quot-and-keep-the-timestamp-and-field/m-p/102458#M26476</link>
      <description>&lt;P&gt;The problem was that the _raw field came from a database and were not prefixed by a timestamp. So what I did in the end was add the following to prepend it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my search | eval _raw=_time + ": " + _raw | collect index=summary
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't have any way of adding the field extractions though that can be done at search time manually.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jul 2013 13:11:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-collect-quot-and-keep-the-timestamp-and-field/m-p/102458#M26476</guid>
      <dc:creator>jameshgibson</dc:creator>
      <dc:date>2013-07-22T13:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use "collect" and keep the timestamp and field extractions of the event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-collect-quot-and-keep-the-timestamp-and-field/m-p/102459#M26477</link>
      <description>&lt;P&gt;You sir are a genius!&lt;BR /&gt;
I know this is an old post, but this is the only solution I've come across that fully solves the issue.&lt;BR /&gt;
Pretty much every other post has some variation of | eval EventTime = _time, which is a decent workaround but doesn't preserve the _time field.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 00:11:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-quot-collect-quot-and-keep-the-timestamp-and-field/m-p/102459#M26477</guid>
      <dc:creator>LeeSart</dc:creator>
      <dc:date>2018-01-16T00:11:22Z</dc:date>
    </item>
  </channel>
</rss>

