<?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 How to extract timestamp without destroying the sequence of original events from my sample data? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386339#M69353</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the following sample event data.&lt;BR /&gt;
 - For some reason, there is no sub-seconds-order data for the timestamp. &lt;BR /&gt;
- Original event data does not have ts_SEQ field; I just added for the reference.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ts,                    ev_id,   val,      ts_SEQ
2018-6-17 08:00:01,     A,          10,       1 
2018-6-17 08:00:01,        B,            0,        2 
2018-6-17 08:00:01,     C,           3,       3
2018-6-17 08:00:11,     A,          20,          4
2018-6-17 08:00:11,     B,           0,          5
2018-6-17 08:00:11,     C,          -1,          6
2018-6-17 08:00:20,     A,           5,          7
2018-6-17 08:00:21,     B,           0,         8
2018-6-17 08:00:21,     C,          12,         9
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I want to do is to extract transactions;  It seems that events A-B-C (ev_id) make one transaction group, almost every ten seconds.  For example, &lt;CODE&gt;transaction startswith=eval(ev_id="A") endswith=eval(ev_id="C")  maxspan=2s&lt;/CODE&gt;  could be applied.&lt;/P&gt;

&lt;P&gt;When I indexed the above sample event data, at Set Source Type step, I chose Source Type=CSV, Timestamp Extraction=AUTO.  What I got  by spl &lt;CODE&gt;source=... | table _time ts ev_id val ts_SEQ | sort _time&lt;/CODE&gt; is shown below.&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/251979-%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2018-06-18-180745.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Unfortunately, the ascending order of _time destroys the original event sequence (ts_SEQ), that means,&lt;BR /&gt;
the above mentioned transaction extraction would be impossible. Currently, my work around is to add the ts_SEQ value to the original data before indexing, and use ts_SEQ to keep the original event sequence.&lt;/P&gt;

&lt;P&gt;Question: How to extract timestamp without destroying the sequence of original events from my sample data?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:01:31 GMT</pubDate>
    <dc:creator>tac24</dc:creator>
    <dc:date>2020-09-29T20:01:31Z</dc:date>
    <item>
      <title>How to extract timestamp without destroying the sequence of original events from my sample data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386339#M69353</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the following sample event data.&lt;BR /&gt;
 - For some reason, there is no sub-seconds-order data for the timestamp. &lt;BR /&gt;
- Original event data does not have ts_SEQ field; I just added for the reference.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ts,                    ev_id,   val,      ts_SEQ
2018-6-17 08:00:01,     A,          10,       1 
2018-6-17 08:00:01,        B,            0,        2 
2018-6-17 08:00:01,     C,           3,       3
2018-6-17 08:00:11,     A,          20,          4
2018-6-17 08:00:11,     B,           0,          5
2018-6-17 08:00:11,     C,          -1,          6
2018-6-17 08:00:20,     A,           5,          7
2018-6-17 08:00:21,     B,           0,         8
2018-6-17 08:00:21,     C,          12,         9
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I want to do is to extract transactions;  It seems that events A-B-C (ev_id) make one transaction group, almost every ten seconds.  For example, &lt;CODE&gt;transaction startswith=eval(ev_id="A") endswith=eval(ev_id="C")  maxspan=2s&lt;/CODE&gt;  could be applied.&lt;/P&gt;

&lt;P&gt;When I indexed the above sample event data, at Set Source Type step, I chose Source Type=CSV, Timestamp Extraction=AUTO.  What I got  by spl &lt;CODE&gt;source=... | table _time ts ev_id val ts_SEQ | sort _time&lt;/CODE&gt; is shown below.&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/251979-%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88-2018-06-18-180745.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Unfortunately, the ascending order of _time destroys the original event sequence (ts_SEQ), that means,&lt;BR /&gt;
the above mentioned transaction extraction would be impossible. Currently, my work around is to add the ts_SEQ value to the original data before indexing, and use ts_SEQ to keep the original event sequence.&lt;/P&gt;

&lt;P&gt;Question: How to extract timestamp without destroying the sequence of original events from my sample data?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:01:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386339#M69353</guid>
      <dc:creator>tac24</dc:creator>
      <dc:date>2020-09-29T20:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract timestamp without destroying the sequence of original events from my sample data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386340#M69354</link>
      <description>&lt;P&gt;Splunk is a time-oriented service.  That is, time sequence matters more than event sequence.   See @dwaddle's answer at &lt;A href="https://answers.splunk.com/answers/665477/retrievedownload-the-original-source-files-after-a.html#answer-665687"&gt;https://answers.splunk.com/answers/665477/retrievedownload-the-original-source-files-after-a.html#answer-665687&lt;/A&gt; for an excellent explanation of this.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386340#M69354</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-06-18T14:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract timestamp without destroying the sequence of original events from my sample data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386341#M69355</link>
      <description>&lt;P&gt;Thanks richgalloway,&lt;/P&gt;

&lt;P&gt;That's what I want to find solutions.&lt;BR /&gt;
In other words, at the indexing stage, if multiple events have same&lt;BR /&gt;
timestamp value (let's assume YYYY-MM-DD HH:MM:SS format), &lt;BR /&gt;
is there any way to keep the sequence of the original events &lt;BR /&gt;
when &lt;CODE&gt;table _time ...&lt;/CODE&gt; command is applied without assist data (ts_SEQ)?&lt;/P&gt;

&lt;P&gt;tac24&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 23:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386341#M69355</guid>
      <dc:creator>tac24</dc:creator>
      <dc:date>2018-06-18T23:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract timestamp without destroying the sequence of original events from my sample data?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386342#M69356</link>
      <description>&lt;P&gt;As dwaddle says, the only guarantee is time.  Events with the exact same timestamp may or may not be returned in the same order in which they appear in the original file.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 00:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-timestamp-without-destroying-the-sequence-of/m-p/386342#M69356</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-06-19T00:44:09Z</dc:date>
    </item>
  </channel>
</rss>

