<?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: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306605#M36626</link>
    <description>&lt;P&gt;The best workaround I have for that is to just write an eval after I bring in my dbxquery. &lt;CODE&gt;|eval CREATED=strptime(CREATED,"%Y-%m-%d %H:%M:%S.%3N")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;you could also use convert. &lt;CODE&gt;|convert mktime(CREATED) timeformat="%Y-%m-%d %H:%M:%S.%3N"&lt;/CODE&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Convert"&gt;https://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Convert&lt;/A&gt;&lt;BR /&gt;
There might be another way, but that's what I do.&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2017 15:48:39 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-05-22T15:48:39Z</dc:date>
    <item>
      <title>Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306604#M36625</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;
I used Splunk DB Connect v1 and now I updated it to Splunk DB Connect v3. I get data from oracle sql.&lt;BR /&gt;
I have several TIMESTAMP type columns that in version 1 were saved in the epoch format, but in version 3 they are stored in human readable format.&lt;/P&gt;

&lt;P&gt;Example (CREATED is TIMESTAMP type):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Version 1: CREATED = 1495450599.159
Version 3: CREATED = 2017-05-22 13:56:39.159
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How to make so that in version 3 TIMESTAMP type was in epoch format?&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 14:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306604#M36625</guid>
      <dc:creator>BigCosta</dc:creator>
      <dc:date>2017-05-22T14:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306605#M36626</link>
      <description>&lt;P&gt;The best workaround I have for that is to just write an eval after I bring in my dbxquery. &lt;CODE&gt;|eval CREATED=strptime(CREATED,"%Y-%m-%d %H:%M:%S.%3N")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;you could also use convert. &lt;CODE&gt;|convert mktime(CREATED) timeformat="%Y-%m-%d %H:%M:%S.%3N"&lt;/CODE&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Convert"&gt;https://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Convert&lt;/A&gt;&lt;BR /&gt;
There might be another way, but that's what I do.&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2017 15:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306605#M36626</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-22T15:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306606#M36627</link>
      <description>&lt;P&gt;Thanks for the quick response!&lt;BR /&gt;
I need to be in the index TIMESTAMP was in epoch.&lt;BR /&gt;
I already have an old index in which TIMESTAMP is in epoch and there are complex searches and applications that use epoch. In my situation, the use of this workaround is very difficult.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 02:37:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306606#M36627</guid>
      <dc:creator>BigCosta</dc:creator>
      <dc:date>2017-05-23T02:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306607#M36628</link>
      <description>&lt;P&gt;add this into your SQL statement:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;trunc((CREATED-TO_DATE('01-01-1970','MM-DD-YYYY')) * 86400) as indexTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2017 11:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306607#M36628</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-23T11:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306608#M36629</link>
      <description>&lt;P&gt;After adding, I get an error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected NUMBER got INTERVAL DAY TO SECOND
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here it works without error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(trunc(CREATED) - TO_DATE('01-01-1970', 'MM-DD-YYYY')) * 86400 as indexTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;BUT time is rounded to one day. This is unacceptable to me. I need original accuracy.&lt;BR /&gt;
In fact, DB Connect v3 converts a TIMESTAMP type to a DATATIME type.&lt;/P&gt;

&lt;P&gt;Can I make DB Connect v3 not do this with TIMESTAMP types, but just keep it in the form in which it is shown in oracle (1495450599.159)?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 04:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306608#M36629</guid>
      <dc:creator>BigCosta</dc:creator>
      <dc:date>2017-05-24T04:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306609#M36630</link>
      <description>&lt;P&gt;I found a workaround for the problem. &lt;BR /&gt;
I changed the SQL query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;round((cast(CREATED as date)-to_date('01011970','MMDDYYYY'))*86400)||'.'||to_char(CREATED, 'FF') as CREATED_EPOCH
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Jun 2017 10:32:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306609#M36630</guid>
      <dc:creator>BigCosta</dc:creator>
      <dc:date>2017-06-05T10:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306610#M36631</link>
      <description>&lt;P&gt;If your problem is resolved, please accept an answer to help future readers.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2017 12:38:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306610#M36631</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-06-05T12:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk DB Connect: How to save TIMESTAMP type fields in Epoch format, not in human readable format?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306611#M36632</link>
      <description>&lt;P&gt;This worked for me:&lt;/P&gt;

&lt;P&gt;trunc((extract(day from (CREATED - to_date('01-JAN-1970','DD-MON-YYYY')))*86400+extract(hour from CREATED)*3600+extract(minute from CREATED)*60+extract(second from CREATED))) as indexTime,&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Splunk-DB-Connect-How-to-save-TIMESTAMP-type-fields-in-Epoch/m-p/306611#M36632</guid>
      <dc:creator>bjbrake</dc:creator>
      <dc:date>2020-09-29T19:10:22Z</dc:date>
    </item>
  </channel>
</rss>

