<?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 Transforms before or after detection of timestamp in props.conf in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195980#M38961</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am getting some annoying messages in splunkd.log&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;03-20-2014 15:47:27.631 +1000 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Thu Mar 20 16:45:00 2014). Context: source::/opt/mydata/PUBLIC_P5MIN_201403201550_20140320154535.CSV|host::amo-web|p5_reports|38558
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I know what this error means but it doesnt really fit with my data. But I suspect I know what its occurring I just want to stop it.&lt;/P&gt;

&lt;P&gt;So I have my CSV data file which is of the following format&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;I,P5MIN,LOCAL_PRICE,1,RUN_DATETIME,DUID,INTERVAL_DATETIME,LOCAL_PRICE_ADJUSTMENT,LOCALLY_CONSTRAINED,LASTCHANGED
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:00:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:05:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:10:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:15:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:20:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:25:00",0,0,"2014/03/19 11:55:29"
I,P5MIN,REGIONSOLUTION,4,RUN_DATETIME,INTERVAL_DATETIME,REGIONID,RRP
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:00:00",STATE1,54.07
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:05:00",STATE1,53.8101
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:10:00",STATE1,53.8101
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:15:00",STATE1,53.8101
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now as you can see there are two sets of data in this file. I am only interested in the last section of data to go into Splunk.&lt;/P&gt;

&lt;P&gt;This is achieved with the following props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[p5_reports]
KV_MODE = none
SHOULD_LINEMERGE = false
TRANSFORMS-filterprices = setnull,getFiveMinutePrices
REPORT-extracts = fiveMinuteCsvExtract
TIME_PREFIX=D,P5MIN,REGIONSOLUTION,[^,]*,[^,]*
TIME_FORMAT=%y/%m/%d %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and associated transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[getFiveMinutePrices]
REGEX = ^D,P5MIN,REGIONSOLUTION,(.*)
DEST_KEY = queue
FORMAT = indexQueue

[fiveMinuteCsvExtract]
DELIMS = ","
FIELDS = "I","P5MIN","REGIONSOLUTION","4","RUN_DATETIME","INTERVAL_DATETIME","REGIONID","RRP"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now this all works fine and my data comes in and _time is associated with the second time field INTERVAL_DATETIME.&lt;/P&gt;

&lt;P&gt;But my logfiles are FULL of these&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;03-20-2014 15:47:27.631 +1000 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Thu Mar 20 16:45:00 2014). Context: source::/opt/mydata/PUBLIC_P5MIN_201403201550_20140320154535.CSV|host::amo-web|p5_reports|38558
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So is props.conf running first and generating these errors BEFORE I have filtered out only the stuff I want?&lt;/P&gt;

&lt;P&gt;ie at what point is the timestamp looked for?&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;after transforms?&lt;/LI&gt;
&lt;LI&gt;before tranforms?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;And for bonus points it will be near impossible to extract both these types of data into seperate sourcetypes as the _times I want will be in different places?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:11:17 GMT</pubDate>
    <dc:creator>phoenixdigital</dc:creator>
    <dc:date>2020-09-28T16:11:17Z</dc:date>
    <item>
      <title>Transforms before or after detection of timestamp in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195980#M38961</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am getting some annoying messages in splunkd.log&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;03-20-2014 15:47:27.631 +1000 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Thu Mar 20 16:45:00 2014). Context: source::/opt/mydata/PUBLIC_P5MIN_201403201550_20140320154535.CSV|host::amo-web|p5_reports|38558
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I know what this error means but it doesnt really fit with my data. But I suspect I know what its occurring I just want to stop it.&lt;/P&gt;

&lt;P&gt;So I have my CSV data file which is of the following format&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;I,P5MIN,LOCAL_PRICE,1,RUN_DATETIME,DUID,INTERVAL_DATETIME,LOCAL_PRICE_ADJUSTMENT,LOCALLY_CONSTRAINED,LASTCHANGED
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:00:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:05:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:10:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:15:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:20:00",0,0,"2014/03/19 11:55:29"
D,P5MIN,LOCAL_PRICE,1,"2014/03/19 12:00:00",DATA1,"2014/03/19 12:25:00",0,0,"2014/03/19 11:55:29"
I,P5MIN,REGIONSOLUTION,4,RUN_DATETIME,INTERVAL_DATETIME,REGIONID,RRP
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:00:00",STATE1,54.07
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:05:00",STATE1,53.8101
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:10:00",STATE1,53.8101
D,P5MIN,REGIONSOLUTION,4,"2014/03/19 12:00:00","2014/03/19 12:15:00",STATE1,53.8101
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now as you can see there are two sets of data in this file. I am only interested in the last section of data to go into Splunk.&lt;/P&gt;

&lt;P&gt;This is achieved with the following props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[p5_reports]
KV_MODE = none
SHOULD_LINEMERGE = false
TRANSFORMS-filterprices = setnull,getFiveMinutePrices
REPORT-extracts = fiveMinuteCsvExtract
TIME_PREFIX=D,P5MIN,REGIONSOLUTION,[^,]*,[^,]*
TIME_FORMAT=%y/%m/%d %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and associated transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[getFiveMinutePrices]
REGEX = ^D,P5MIN,REGIONSOLUTION,(.*)
DEST_KEY = queue
FORMAT = indexQueue

[fiveMinuteCsvExtract]
DELIMS = ","
FIELDS = "I","P5MIN","REGIONSOLUTION","4","RUN_DATETIME","INTERVAL_DATETIME","REGIONID","RRP"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now this all works fine and my data comes in and _time is associated with the second time field INTERVAL_DATETIME.&lt;/P&gt;

&lt;P&gt;But my logfiles are FULL of these&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;03-20-2014 15:47:27.631 +1000 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Thu Mar 20 16:45:00 2014). Context: source::/opt/mydata/PUBLIC_P5MIN_201403201550_20140320154535.CSV|host::amo-web|p5_reports|38558
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So is props.conf running first and generating these errors BEFORE I have filtered out only the stuff I want?&lt;/P&gt;

&lt;P&gt;ie at what point is the timestamp looked for?&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;after transforms?&lt;/LI&gt;
&lt;LI&gt;before tranforms?&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;And for bonus points it will be near impossible to extract both these types of data into seperate sourcetypes as the _times I want will be in different places?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:11:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195980#M38961</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2020-09-28T16:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Transforms before or after detection of timestamp in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195981#M38962</link>
      <description>&lt;P&gt;Timestamps are extracted before transforms.&lt;/P&gt;

&lt;P&gt;Maybe you can craft a more complex regex for &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt;?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX= ^([^,]*,){5}(\w+,)?\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which in theory (not tested it) should make the 6th element optional. In the example above &lt;CODE&gt;\w&lt;/CODE&gt; is used for matching this part. Adjust as needed.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 08:45:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195981#M38962</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-03-20T08:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Transforms before or after detection of timestamp in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195982#M38963</link>
      <description>&lt;P&gt;Additionally, if the header rows are part of the file they will also generate these errors (since they do not contain any timestamp). Perhaps you should change your nullQueue:ing a bit to drop them too.&lt;/P&gt;

&lt;P&gt;props&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[p5_reports]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TRANSFORMS-filterprices = setnull,getFiveMinutePrices, drop5mHeader&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;transforms&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[setnull]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = .&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = queue&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[getFiveMinutePrices]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = REGIONSOLUTION&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = queue&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = indexQueue&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[drop5mHeader]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = REGIONID&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = queue&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;SEDCMD in props is an alternative for removing headers.&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 09:00:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195982#M38963</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-03-20T09:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Transforms before or after detection of timestamp in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195983#M38964</link>
      <description>&lt;P&gt;This is exactly what I came here to post but you beat me to it.&lt;/P&gt;

&lt;P&gt;The data file example I provided about is only an example. There are actually 6 header rows and I am getting 6 errors.&lt;/P&gt;

&lt;P&gt;So yes there is nothing really I can do about these errors I just need to live with them.&lt;/P&gt;

&lt;P&gt;Thanks for the regexp tip though.&lt;/P&gt;

&lt;P&gt;I dont think I will be able to extract both sets of data into different sourcetypes unless transforms.conf allows me to override a sourcetype setting for a particular event if it matches a particular regexp.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 23:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195983#M38964</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2014-03-20T23:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Transforms before or after detection of timestamp in props.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195984#M38965</link>
      <description>&lt;P&gt;Actually it might be possible with this in transforms.conf&lt;/P&gt;

&lt;P&gt;[&lt;UNIQUE_STANZA_NAME&gt;]&lt;BR /&gt;
REGEX = &lt;YOUR_REGEX&gt;&lt;BR /&gt;
FORMAT = sourcetype::&lt;YOUR_CUSTOM_SOURCETYPE_VALUE&gt;&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/YOUR_CUSTOM_SOURCETYPE_VALUE&gt;&lt;/YOUR_REGEX&gt;&lt;/UNIQUE_STANZA_NAME&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/Data/Advancedsourcetypeoverrides"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.2/Data/Advancedsourcetypeoverrides&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But I am straying far from my original question now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 23:39:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Transforms-before-or-after-detection-of-timestamp-in-props-conf/m-p/195984#M38965</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2014-03-20T23:39:12Z</dc:date>
    </item>
  </channel>
</rss>

