<?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: Change _time before indexing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348058#M63904</link>
    <description>&lt;P&gt;Thanks @tiagofbmm for the quick reply to my question.&lt;/P&gt;

&lt;P&gt;The problem that I have in my data is that, this is a report file, generated daily, but with data from previous day.&lt;/P&gt;

&lt;P&gt;In the example that I posted, the report, was generated on 2018/03/12.&lt;BR /&gt;
"RH",2018/03/12 03:21:40 -0700,,"Z76LVNG7N"&lt;/P&gt;

&lt;P&gt;The data  (in the lines that start with SB), contains a field that splunk is using as timestamp&lt;BR /&gt;
"SB","123456","Z76LVNG7N","3456789","","","T0006",&lt;STRONG&gt;2018/03/11 00:02:26 -0800&lt;/STRONG&gt;,2018/03/11 00:02:26 -0800,"aa",234,"rud","ee",4,"eyt","S",,0,0,"dhl, bla, Postage, Ins:$0.00","","N","ShipSvc:First Class Package, blablabla, Postage, Ins:$0.00","","","","","","",,"","","","Express Checkout","01","02","","","","","","S","US" &lt;/P&gt;

&lt;P&gt;In this example that I am sharing, I want to convert the date &lt;STRONG&gt;2018/03/11 00:02:26 -0800&lt;/STRONG&gt; to &lt;STRONG&gt;2018/03/12 00:02:26 -0800&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I thought that using this eval in the props.conf of my indexer would change the value of _time, before the data is indexed.&lt;/P&gt;

&lt;P&gt;Currently, after cleaning the index and reindex my data, nothing happens. I suspect that I may need to use a TRANSFORM instructions.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Mar 2018 18:08:39 GMT</pubDate>
    <dc:creator>nuaraujo</dc:creator>
    <dc:date>2018-03-13T18:08:39Z</dc:date>
    <item>
      <title>Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348055#M63901</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I need to sum 1 day(86400 seconds) to my _time, if the event(_raw) includes the string "SB". This needs to be done, before indexing data.&lt;/P&gt;

&lt;P&gt;My data is like this:&lt;BR /&gt;
&lt;STRONG&gt;"RH",2018/03/12 03:21:40 -0700,,"Z76LVNG7N"&lt;BR /&gt;
"FH",01&lt;BR /&gt;
"SH",2018/03/11 00:00:00 -0800,2018/03/11 23:59:59 -0700,"Z76LVNG99RA7N",""&lt;BR /&gt;
"SB","123456","Z76LVNG7N","3456789","","","T0006",2018/03/11 00:02:26 -0800,2018/03/11 00:02:26 -0800,"aa",234,"rud","ee",4,"eyt","S",,0,0,"dhl, bla, Postage, Ins:$0.00","","N","ShipSvc:First Class Package, blablabla, Postage, Ins:$0.00","","","","","","",,"","","","Express Checkout","01","02","","","","","","S","US"&lt;BR /&gt;
"SB","1234564","Z76LVNG7N","34567894","","","T0006",2018/03/11 00:03:26 -0600,2018/03/11 00:02:26 -0800,"aa",234,"rud","ee",4,"eyt","S",,0,0,"dhl, bla, Postage, Ins:$0.00","","N","ShipSvc:First Class Package, blablabla, Postage, Ins:$0.00","","","","","","",,"","","","Express Checkout","01","02","","","","","","S","US"&lt;BR /&gt;
"FF",2&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;To achieve this, I am using EVAL-_time in props .conf&lt;BR /&gt;
&lt;STRONG&gt;[mydata]&lt;BR /&gt;
DATETIME_CONFIG =&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
TRANSFORMS-sourcetype = metadata,events,discard&lt;BR /&gt;
REPORT-report_timestamp = report_timestamp&lt;BR /&gt;
category = Custom&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
FIELD_HEADER_REGEX = ^\"(?:CH)\"&lt;BR /&gt;
FIELD_DELIMITER = ,&lt;BR /&gt;
*EVAL-_time = strftime(if(match(_raw,"SB"),_time+86400,_time),"%Y/%m/%d %H:%M:%S %z")&lt;/STRONG&gt;*&lt;/P&gt;

&lt;P&gt;Can someone help me understand what am I doing wrong?&lt;/P&gt;

&lt;P&gt;NOTE: I tested this EVAL string during search time and it works well.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348055#M63901</guid>
      <dc:creator>nuaraujo</dc:creator>
      <dc:date>2020-09-29T18:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348056#M63902</link>
      <description>&lt;P&gt;The EVAL you are setting in the props.conf is not done on Index Time.&lt;/P&gt;

&lt;P&gt;It is done every time you do a search on that sourcetype &lt;STRONG&gt;mydata&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;What exactly are you seeing, the time is not modified as you expected?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348056#M63902</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-13T17:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348057#M63903</link>
      <description>&lt;P&gt;Hey nuaraujo,&lt;/P&gt;

&lt;P&gt;Can you try adding something as TZ_ALIAS in props.conf&lt;BR /&gt;
Refer this link :&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Applytimezoneoffsetstotimestamps"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/Applytimezoneoffsetstotimestamps&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Let me know if this helps!!&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 17:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348057#M63903</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-03-13T17:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348058#M63904</link>
      <description>&lt;P&gt;Thanks @tiagofbmm for the quick reply to my question.&lt;/P&gt;

&lt;P&gt;The problem that I have in my data is that, this is a report file, generated daily, but with data from previous day.&lt;/P&gt;

&lt;P&gt;In the example that I posted, the report, was generated on 2018/03/12.&lt;BR /&gt;
"RH",2018/03/12 03:21:40 -0700,,"Z76LVNG7N"&lt;/P&gt;

&lt;P&gt;The data  (in the lines that start with SB), contains a field that splunk is using as timestamp&lt;BR /&gt;
"SB","123456","Z76LVNG7N","3456789","","","T0006",&lt;STRONG&gt;2018/03/11 00:02:26 -0800&lt;/STRONG&gt;,2018/03/11 00:02:26 -0800,"aa",234,"rud","ee",4,"eyt","S",,0,0,"dhl, bla, Postage, Ins:$0.00","","N","ShipSvc:First Class Package, blablabla, Postage, Ins:$0.00","","","","","","",,"","","","Express Checkout","01","02","","","","","","S","US" &lt;/P&gt;

&lt;P&gt;In this example that I am sharing, I want to convert the date &lt;STRONG&gt;2018/03/11 00:02:26 -0800&lt;/STRONG&gt; to &lt;STRONG&gt;2018/03/12 00:02:26 -0800&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I thought that using this eval in the props.conf of my indexer would change the value of _time, before the data is indexed.&lt;/P&gt;

&lt;P&gt;Currently, after cleaning the index and reindex my data, nothing happens. I suspect that I may need to use a TRANSFORM instructions.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 18:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348058#M63904</guid>
      <dc:creator>nuaraujo</dc:creator>
      <dc:date>2018-03-13T18:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348059#M63905</link>
      <description>&lt;P&gt;Thanks deepashri, but a TZ_ALIAS will not solve my issue because I the data is from the previous day. I really need to sum 86400 seconds to the _time field.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 18:26:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348059#M63905</guid>
      <dc:creator>nuaraujo</dc:creator>
      <dc:date>2018-03-13T18:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348060#M63906</link>
      <description>&lt;P&gt;I'm not sure  you can change an indexed field such as _time with an EVAL in the props.conf. Could you test doing an EVAL to another field, such as &lt;STRONG&gt;time_test&lt;/STRONG&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348060#M63906</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2020-09-29T18:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348061#M63907</link>
      <description>&lt;P&gt;Hey I just tested your exact EVAL and you do can change it in Search Time with that EVAL.&lt;BR /&gt;
The problem is not the time itself, I think it is the strptime:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Change the expression to EVAL-_time=if(match(_raw,"SB"),_time+86400,_time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also...&lt;BR /&gt;
Have you restarted Splunk after changing the props? (Pardon me if it is a stupid question, but I don't see anything else wrong with the eval expression)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 18:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348061#M63907</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-13T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348062#M63908</link>
      <description>&lt;P&gt;During Search Time, works really well. I already tested it before.&lt;/P&gt;

&lt;P&gt;At this stage, there are no stupid questions @tiagofbmm, but yes, I restarted my indexer and deleted the previous data in it. I guaranteed that the indexer was clean, before all my test.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://ibb.co/gFHyec"&gt;https://ibb.co/gFHyec&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://ibb.co/gFHyec" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://ibb.co/gFHyec"&gt;link text&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 18:56:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348062#M63908</guid>
      <dc:creator>nuaraujo</dc:creator>
      <dc:date>2018-03-13T18:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348063#M63909</link>
      <description>&lt;P&gt;This is really weird. I just ingested your line of data, created a calculated field in the UI (that goes exactly to props as you have): EVAL-_time=if(match(_raw,"SB"),_time+86400,_time)&lt;/P&gt;

&lt;P&gt;And it works like a charm.&lt;/P&gt;

&lt;P&gt;Maybe it's time to doubt from more basic things. &lt;/P&gt;

&lt;P&gt;Can you do a $SPLUNK_HOME/bin/splunk btool props list --debug and look for your EVAL and see if is a running configuration?&lt;/P&gt;

&lt;P&gt;Btw, when splunk comes up, the logs say something about a misconfiguration ?&lt;/P&gt;

&lt;P&gt;What is that Report-timestamp doing?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:28:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348063#M63909</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2020-09-29T18:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348064#M63910</link>
      <description>&lt;P&gt;@tiagofbmm, THANK YOU. It works.&lt;/P&gt;

&lt;P&gt;Your suggestions makes total sense, because the _time is in seconds, even if it is shown as a normal date.&lt;/P&gt;

&lt;P&gt;NOTE: Do you know how to mark your answer as "accepted answer"?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 19:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348064#M63910</guid>
      <dc:creator>nuaraujo</dc:creator>
      <dc:date>2018-03-13T19:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348065#M63911</link>
      <description>&lt;P&gt;Yes, I promoted my last  &lt;STRONG&gt;comment&lt;/STRONG&gt; to an &lt;STRONG&gt;answer&lt;/STRONG&gt; so please accept it below&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 19:37:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348065#M63911</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-13T19:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348066#M63912</link>
      <description>&lt;P&gt;Thanks @tiagofbmm&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 19:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/348066#M63912</guid>
      <dc:creator>nuaraujo</dc:creator>
      <dc:date>2018-03-13T19:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change _time before indexing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/510495#M86773</link>
      <description>&lt;LI-CODE lang="markup"&gt;EVAL-_time = if(match(_raw,"SB"), _time+86400, _time)&lt;/LI-CODE&gt;&lt;P&gt;Fixing the formatting issues caused by the transition to Khoros, copied from the&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/79568"&gt;@tiagofbmm&lt;/a&gt;&amp;nbsp;post&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 16:59:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-time-before-indexing/m-p/510495#M86773</guid>
      <dc:creator>malvidin</dc:creator>
      <dc:date>2020-07-22T16:59:33Z</dc:date>
    </item>
  </channel>
</rss>

