<?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: YYYYMM timestamp - can Splunk extract time using strptime? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234607#M45705</link>
    <description>&lt;P&gt;Yeah sorry i was on my mobile so I didnt have a chance to look it up.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Deploy/Datapipeline"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Deploy/Datapipeline&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So given that SEDCMD cant be done prior to TIME_FORMAT, you have a few options that I see.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Rewrite the code that generates the source as was suggested&lt;/LI&gt;
&lt;LI&gt;Use a rex in your search &lt;CODE&gt;...| rex field=PERIOD "s/(20\d{4})/\101/g" | eval _time=strptime(PERIOD,"%Y%m%d") | ...&lt;/CODE&gt; &lt;/LI&gt;
&lt;LI&gt;Use a rex in your search and take it to a summary index, then run searches on the summary index.&lt;/LI&gt;
&lt;LI&gt;More options exist but these are some of the better ones I can think of.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Sun, 17 Jan 2016 12:47:42 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-01-17T12:47:42Z</dc:date>
    <item>
      <title>YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234602#M45700</link>
      <description>&lt;P&gt;My data format can be seen below (CSV). The date field ("PERIOD") is in %Y%m format.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...,PERIOD
...,201512 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Although the following props.conf does not work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ csv ]
CHARSET=UTF-8
INDEXED_EXTRACTIONS=csv
KV_MODE=none
SHOULD_LINEMERGE=false
category=Structured
TIME_FORMAT=%Y%m
TIMESTAMP_FIELDS=PERIOD
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas what I'm doing wrong guys?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 21:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234602#M45700</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2016-01-15T21:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234603#M45701</link>
      <description>&lt;P&gt;The minimum time format should include the day and month (year can be optional). If you've control over how you log your data, add the day part as well (you can default it to 01 for first day of month). Once you've that, above setting (with updated TIME_FORMAT) should work fine.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 22:15:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234603#M45701</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-01-15T22:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234604#M45702</link>
      <description>&lt;P&gt;Got it, thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2016 10:39:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234604#M45702</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2016-01-16T10:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234605#M45703</link>
      <description>&lt;P&gt;Try adding this sedcmd before the time_format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sedcmd-AddDayToDate = "s/(20\d{4})/\101/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What this will do is match &lt;CODE&gt;20&lt;/CODE&gt; followed by 4 digits (ex &lt;CODE&gt;201601&lt;/CODE&gt;, &lt;CODE&gt;209912&lt;/CODE&gt;, etc.), and when it finds this match it will replace it with whatever the original 6 digits were, plus it will add 01 for the first day of the month.&lt;/P&gt;

&lt;P&gt;So in the end, the field should have a correct date value.  You may wish to change it to \130 to always have it show on the 30th day instead, etc.&lt;/P&gt;

&lt;P&gt;The uncertainty that comes for me is that I'm not sure if sedcmd will work prior to time_prefix or not.   So please give this a try and let me know.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2016 12:36:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234605#M45703</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-16T12:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234606#M45704</link>
      <description>&lt;P&gt;Thanks! However, it would appear timestamp processing happens before any sedcmd's thus ruling this approach out.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 08:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234606#M45704</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2016-01-17T08:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234607#M45705</link>
      <description>&lt;P&gt;Yeah sorry i was on my mobile so I didnt have a chance to look it up.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Deploy/Datapipeline"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Deploy/Datapipeline&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So given that SEDCMD cant be done prior to TIME_FORMAT, you have a few options that I see.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Rewrite the code that generates the source as was suggested&lt;/LI&gt;
&lt;LI&gt;Use a rex in your search &lt;CODE&gt;...| rex field=PERIOD "s/(20\d{4})/\101/g" | eval _time=strptime(PERIOD,"%Y%m%d") | ...&lt;/CODE&gt; &lt;/LI&gt;
&lt;LI&gt;Use a rex in your search and take it to a summary index, then run searches on the summary index.&lt;/LI&gt;
&lt;LI&gt;More options exist but these are some of the better ones I can think of.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 17 Jan 2016 12:47:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234607#M45705</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-17T12:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234608#M45706</link>
      <description>&lt;P&gt;You may have to urlencode that rex because the '{}' characters.&lt;/P&gt;

&lt;P&gt;here it is encoded &lt;CODE&gt;... | rex field=PERIOD "s/(20\d%7B4%7D)/\101/g"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 12:51:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234608#M45706</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-01-17T12:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: YYYYMM timestamp - can Splunk extract time using strptime?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234609#M45707</link>
      <description>&lt;P&gt;try with    &lt;CODE&gt;TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%N&lt;/CODE&gt; instead &lt;CODE&gt;TIME_FORMAT=%Y%m&lt;/CODE&gt; in your props.conf&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 08:59:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/YYYYMM-timestamp-can-Splunk-extract-time-using-strptime/m-p/234609#M45707</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2016-01-21T08:59:04Z</dc:date>
    </item>
  </channel>
</rss>

