<?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: _time field is lost after merging events with command transaction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387315#M112997</link>
    <description>&lt;P&gt;I would avoid &lt;CODE&gt;transaction&lt;/CODE&gt; completely.  You can do much the same thing like this and it scales better:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Base Search Here
| stats list(_raw) AS _raw range(_time) AS duration min(_time) AS _time max(_time) AS end_time values(foo) AS foo other stuff here BY id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Jul 2018 17:41:05 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2018-07-18T17:41:05Z</dc:date>
    <item>
      <title>_time field is lost after merging events with command transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387310#M112992</link>
      <description>&lt;P&gt;I want to merge multiple events that contains the same ID into an unique event. For example:&lt;BR /&gt;
  &lt;CODE&gt;&lt;BR /&gt;
{id: 123&lt;BR /&gt;
setDate: 2018-08-18&lt;BR /&gt;
status: completed&lt;BR /&gt;
},&lt;BR /&gt;
{id: 123&lt;BR /&gt;
setDate: 2018-08-17&lt;BR /&gt;
status: started&lt;BR /&gt;
}&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;To solve it I am using the &lt;CODE&gt;transaction&lt;/CODE&gt; function. Therefore it seems &lt;CODE&gt;_time&lt;/CODE&gt; is overridden by &lt;CODE&gt;transaction&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;How could I merge the events without override &lt;CODE&gt;_time&lt;/CODE&gt; or how could I extract override after merging?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 20:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387310#M112992</guid>
      <dc:creator>edigilink</dc:creator>
      <dc:date>2018-06-18T20:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: _time field is lost after merging events with command transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387311#M112993</link>
      <description>&lt;P&gt;When you use the transaction command, the merged raw data will have timestamp/_time value of event that occurred the earliest (min of _time). If you want to have reference to _time of other event(s) as well, create a new field (e.g. &lt;CODE&gt;| eval Timestmap=_time&lt;/CODE&gt; OR  &lt;CODE&gt;| eval Timestmap=strftime(_time,"%F %T")&lt;/CODE&gt; based on you want to retain epoch or string formatted date) before transaction.&lt;/P&gt;

&lt;P&gt;Also, if all you do is merge based on id field, then use a stats command instead of using transaction to merge those events together. Just include appropriate fields in stats's aggregation list.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:05:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387311#M112993</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T20:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: _time field is lost after merging events with command transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387312#M112994</link>
      <description>&lt;P&gt;Hello @somesoni2, thanks for replying. Perhaps my question is not complete. I would like to keep _time so I can use in timechart (which uses _time as x-axis by default).&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 18:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387312#M112994</guid>
      <dc:creator>edigilink</dc:creator>
      <dc:date>2018-06-19T18:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: _time field is lost after merging events with command transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387313#M112995</link>
      <description>&lt;P&gt;Hi - Did you try what &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt; suggested?&lt;BR /&gt;
Basically, what he is trying ti say is  - if you need the _time field , you need to assign to an eval function BEFORE the pipe where your _time gets lost, then you need to set _time = the field that you stored the  _time value, something like this :&lt;CODE&gt;eval k=strptime(strftime(_time,"%Y-%m-%d%H:%M:S"),"%Y-%m-%d%H:%M:%S")|....|.....|....|eval _time=k| timechart xxxxx&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:08:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387313#M112995</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-29T20:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: _time field is lost after merging events with command transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387314#M112996</link>
      <description>&lt;P&gt;Hello @Sukisen1981. Sorry for the delay. Yes, I tried and it worked! Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 16:26:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387314#M112996</guid>
      <dc:creator>edigilink</dc:creator>
      <dc:date>2018-07-18T16:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: _time field is lost after merging events with command transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387315#M112997</link>
      <description>&lt;P&gt;I would avoid &lt;CODE&gt;transaction&lt;/CODE&gt; completely.  You can do much the same thing like this and it scales better:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Base Search Here
| stats list(_raw) AS _raw range(_time) AS duration min(_time) AS _time max(_time) AS end_time values(foo) AS foo other stuff here BY id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 17:41:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-field-is-lost-after-merging-events-with-command-transaction/m-p/387315#M112997</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-07-18T17:41:05Z</dc:date>
    </item>
  </channel>
</rss>

