<?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: Timestamp problem with DB Connect in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140506#M97889</link>
    <description>&lt;P&gt;The datatype for this field is datetime2. Could that be the problem? I tried to cast the field to datetime but it's still not working correctly&lt;/P&gt;</description>
    <pubDate>Thu, 25 Sep 2014 15:51:19 GMT</pubDate>
    <dc:creator>jedatt01</dc:creator>
    <dc:date>2014-09-25T15:51:19Z</dc:date>
    <item>
      <title>Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140500#M97883</link>
      <description>&lt;P&gt;I have a MSSQL Datasource and having trouble parsing the timestamps (ProcessWorkStart field) correctly. For some reason it is parsing all events with the exact same timestamp (1969-12-31 18:59:59.999) no matter how I am configuring the inputs.conf. Please help! See below a sample event and my inputs.conf&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;SAMPLE EVENT&lt;/STRONG&gt;&lt;BR /&gt;
    1969-12-31 18:59:59.999 CoreWorkerProcessResultId=37114016 CoreProcessId=2 CoreProcess="xxxxxxx" CoreWorkerId=1 CoreWorker=xxxxxxxx GetWorkStart="2014-09-14 03:15:48.7170000" GetWorkMs=54 TotalWorkCount=0 GetTotalWorkCountMs=1 HasWork=false MessageCount=0 ProcessWorkMs=0&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Inputs.conf&lt;/STRONG&gt;&lt;BR /&gt;
    [dbmon-tail://SAMMY/SAMMY_Oper_Logs]&lt;BR /&gt;
    index = emme&lt;BR /&gt;
    interval = 60&lt;BR /&gt;
    output.format = kv&lt;BR /&gt;
    output.timestamp = 1&lt;BR /&gt;
    output.timestamp.column = ProcessWorkStart&lt;BR /&gt;
    output.timestamp.format = yyyy-MM-dd HH:mm:ss.SSS&lt;BR /&gt;
    query = select  [CoreWorkerProcessResultId]\r\n      ,cwpr.[CoreProcessId]\r\n      ,cp.Description as [CoreProcess]\r\n      ,cwpr.[CoreWorkerId]\r\n      ,cw.Description as [CoreWorker]\r\n      ,[GetWorkStart]\r\n      ,[GetWorkMs]\r\n      ,[TotalWorkCount]\r\n      ,[GetTotalWorkCountMs]\r\n      ,[HasWork]\r\n      ,[MessageCount]\r\n      ,[ProcessWorkStart]\r\n      ,[ProcessWorkMs]\r\n from CoreWorkerProcessResult cwpr  \r\n   inner join CoreProcess cp on cp.CoreProcessId = cwpr.CoreProcessId\r\n  inner join CoreWorker cw on cw.CoreWorkerId = cwpr.CoreWorkerId\r\n where cwpr.CoreWorkerProcessResultId &amp;gt; 37000000 {{AND $rising_column$}}&lt;BR /&gt;
    sourcetype = emme_core_stat&lt;BR /&gt;
    tail.rising.column = CoreWorkerProcessResultId&lt;BR /&gt;
    table = EMME_Oper_Logs&lt;BR /&gt;
    disabled = 1&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:42:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140500#M97883</guid>
      <dc:creator>jedatt01</dc:creator>
      <dc:date>2020-09-28T17:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140501#M97884</link>
      <description>&lt;P&gt;You have a space in your time stamp format. Try throwing quotes around the string.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 13:52:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140501#M97884</guid>
      <dc:creator>antlefebvre</dc:creator>
      <dc:date>2014-09-25T13:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140502#M97885</link>
      <description>&lt;P&gt;Use the java timestamp format. Not the Splunk Timestamp format in &lt;CODE&gt;output.timestamp.format&lt;/CODE&gt; . DBConnect &lt;/P&gt;

&lt;P&gt;Check the links below. 1st one is the Splunks DOC and the line mentioned is what Splunk says on what timestamp to use.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/DBX/1.1.4/DeployDBX/Configuredatabasemonitoring"&gt;http://docs.splunk.com/Documentation/DBX/1.1.4/DeployDBX/Configuredatabasemonitoring&lt;/A&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;4. Specify the Timestamp format. This is a Java SimpleDateFormat pattern. The default format is configurable during setup. 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This link talks about the timeformat in java.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"&gt;http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps.&lt;BR /&gt;
theou&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 14:21:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140502#M97885</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2014-09-25T14:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140503#M97886</link>
      <description>&lt;P&gt;This is still not working. I'm not sure whats the problem is.&lt;/P&gt;

&lt;P&gt;Inputs.conf&lt;BR /&gt;
    [dbmon-tail://SAMMY/SAMMY_Oper_Logs]&lt;BR /&gt;
    index = emme&lt;BR /&gt;
    interval = 60&lt;BR /&gt;
    output.format = kv&lt;BR /&gt;
    output.timestamp = 1&lt;BR /&gt;
    output.timestamp.column = ProcessWorkStart&lt;BR /&gt;
    output.timestamp.format = "yyyy-MM-dd HH:mm:ss.SSS"&lt;BR /&gt;
    query = select [CoreWorkerProcessResultId]rn ,cwpr.[CoreProcessId]rn ,cp.Description as [CoreProcess]rn ,cwpr.[CoreWorkerId]rn ,cw.Description as [CoreWorker]rn ,[GetWorkStart]rn ,[GetWorkMs]rn ,[TotalWorkCount]rn ,[GetTotalWorkCountMs]rn ,[HasWork]rn ,[MessageCount]rn ,[ProcessWorkStart]rn ,[ProcessWorkMs]rn from CoreWorkerProcessResult cwpr rn inner join CoreProcess cp on cp.CoreProcessId = cwpr.CoreProcessIdrn inner join CoreWorker cw on cw.CoreWorkerId = cwpr.CoreWorkerIdrn where cwpr.CoreWorkerProcessResultId &amp;gt; 37000000 {{AND $rising_column$}}&lt;BR /&gt;
    sourcetype = emme_core_stat&lt;BR /&gt;
    tail.rising.column = CoreWorkerProcessResultId&lt;BR /&gt;
    table = EMME_Oper_Logs&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:42:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140503#M97886</guid>
      <dc:creator>jedatt01</dc:creator>
      <dc:date>2020-09-28T17:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140504#M97887</link>
      <description>&lt;P&gt;I've followed the java format, but still something is missing here, I can't understand why it won't read the timestamp i've asked it to&lt;/P&gt;

&lt;P&gt;This is still not working. I'm not sure whats the problem is.&lt;/P&gt;

&lt;P&gt;Inputs.conf&lt;BR /&gt;
    [dbmon-tail://SAMMY/SAMMY_Oper_Logs]&lt;BR /&gt;
    index = emme&lt;BR /&gt;
    interval = 60&lt;BR /&gt;
    output.format = kv&lt;BR /&gt;
    output.timestamp = 1&lt;BR /&gt;
    output.timestamp.column = ProcessWorkStart&lt;BR /&gt;
    output.timestamp.format = "yyyy-MM-dd HH:mm:ss.SSS"&lt;BR /&gt;
    query = select [CoreWorkerProcessResultId]rn ,cwpr.[CoreProcessId]rn ,cp.Description as [CoreProcess]rn ,cwpr.[CoreWorkerId]rn ,cw.Description as [CoreWorker]rn ,[GetWorkStart]rn ,[GetWorkMs]rn ,[TotalWorkCount]rn ,[GetTotalWorkCountMs]rn ,[HasWork]rn ,[MessageCount]rn ,[ProcessWorkStart]rn ,[ProcessWorkMs]rn from CoreWorkerProcessResult cwpr rn inner join CoreProcess cp on cp.CoreProcessId = cwpr.CoreProcessIdrn inner join CoreWorker cw on cw.CoreWorkerId = cwpr.CoreWorkerIdrn where cwpr.CoreWorkerProcessResultId &amp;gt; 37000000 {{AND $rising_column$}}&lt;BR /&gt;
    sourcetype = emme_core_stat&lt;BR /&gt;
    tail.rising.column = CoreWorkerProcessResultId&lt;BR /&gt;
    table = EMME_Oper_Logs&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:42:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140504#M97887</guid>
      <dc:creator>jedatt01</dc:creator>
      <dc:date>2020-09-28T17:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140505#M97888</link>
      <description>&lt;P&gt;Splunk may be reading the time stamp as a string. Try this solution from the link theou provided :&lt;/P&gt;

&lt;P&gt;For example, when Splunk indexes your data, it looks for a timestamp of the DATETIME datatype. If your timestamp is a string value (such as VARCHAR, NVARCHAR, etc.), you can try to convert the timestamp to the correct datatype using a custom SQL statement with CAST, CONVERT, or TO_TIMESTAMP functions.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 15:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140505#M97888</guid>
      <dc:creator>antlefebvre</dc:creator>
      <dc:date>2014-09-25T15:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140506#M97889</link>
      <description>&lt;P&gt;The datatype for this field is datetime2. Could that be the problem? I tried to cast the field to datetime but it's still not working correctly&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 15:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140506#M97889</guid>
      <dc:creator>jedatt01</dc:creator>
      <dc:date>2014-09-25T15:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140507#M97890</link>
      <description>&lt;P&gt;Does this query work when you try it in Db Query? Remove the tailing part and see if this works. If it does, then do a Cast on the time. After that change the &lt;CODE&gt;where cwpr.CoreWorkerProcessResultId &amp;gt; 37000000 {{AND $rising_column$}}&lt;/CODE&gt; to &lt;CODE&gt;{{ where cwpr.CoreWorkerProcessResultId &amp;gt; 37000000 AND $rising_column$ &amp;gt; ?}}&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140507#M97890</guid>
      <dc:creator>theouhuios</dc:creator>
      <dc:date>2014-09-25T17:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp problem with DB Connect</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140508#M97891</link>
      <description>&lt;P&gt;I figured it out. I ended up casting the appropriate field to datetime type then removed the output.timestamp.format = "yyyy-MM-dd HH:mm:ss.SSS" from props.conf and it worked! Thanks everyone for helping me get there!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-problem-with-DB-Connect/m-p/140508#M97891</guid>
      <dc:creator>jedatt01</dc:creator>
      <dc:date>2014-09-25T17:25:56Z</dc:date>
    </item>
  </channel>
</rss>

