<?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: How do you extract timestamp in Mysql database column? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136124#M184745</link>
    <description>&lt;P&gt;Yes, I did. &lt;/P&gt;

&lt;P&gt;input type: Tail &lt;BR /&gt;
database: sakali &lt;BR /&gt;
x Specify SQL Query: select * from rental {{WHERE $rising_column$ &amp;gt; ?}}&lt;BR /&gt;
rissing_collumn: rental_id&lt;BR /&gt;
sourcetype: database-sakali&lt;BR /&gt;
index: main&lt;BR /&gt;
host: serverbd&lt;/P&gt;

&lt;P&gt;Output Format : key-value format&lt;BR /&gt;
Timestamp column: rental_date&lt;BR /&gt;
Timestamp format:&lt;BR /&gt;
interval: auto&lt;/P&gt;

&lt;P&gt;There is a result:&lt;/P&gt;

&lt;P&gt;Splunk Timestamp                       event&lt;BR /&gt;
7/9/14 11:59:57.000 PM ||   2005-06-20T23:59:57.000 rental_id=3194 inventory_id=1835 customer_id=432 (..)&lt;/P&gt;

&lt;P&gt;any idea?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:01:56 GMT</pubDate>
    <dc:creator>dfigurello</dc:creator>
    <dc:date>2020-09-28T17:01:56Z</dc:date>
    <item>
      <title>How do you extract timestamp in Mysql database column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136120#M184741</link>
      <description>&lt;P&gt;Hi splunkers, &lt;/P&gt;

&lt;P&gt;I am collecting data using dbconnect and I am studying about this application, then I installed mysql server 5.6 and  installed a sample database called sakali. &lt;BR /&gt;
There is a table called rental with sample values to study. &lt;/P&gt;

&lt;P&gt;The structure is:&lt;BR /&gt;
rental_id | rental_date | inventory_id | customer_id | return_date | staff_id | last_update&lt;/P&gt;

&lt;P&gt;I am trying to index data, but I've had problem with splunk timestamp. &lt;/P&gt;

&lt;P&gt;Follows above the data input configuration:&lt;/P&gt;

&lt;P&gt;input type: Tail &lt;BR /&gt;
database: sakali &lt;BR /&gt;
x Specify SQL Query: select * from rental {{WHERE $rising_column$ &amp;gt; ?}}&lt;BR /&gt;
rissing_collumn: rental_id&lt;BR /&gt;
sourcetype: database-sakali&lt;BR /&gt;
index: main&lt;BR /&gt;
host: serverbd&lt;/P&gt;

&lt;P&gt;Output Format : key-value format&lt;BR /&gt;
Timestamp column: rental_date&lt;BR /&gt;
Timestamp format: yyyy-MM-dd HH:mm:ss&lt;BR /&gt;
interval: auto&lt;/P&gt;

&lt;P&gt;When I runs the search, the timestamp just time is correct and the date is wrong. &lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;Timestamp Splunk:           events&lt;BR /&gt;
7/8/14 11:59:57.000 PM || 2005-06-20 23:59:57 rental_id=3194 inventory_id=1835&lt;/P&gt;

&lt;P&gt;7/8/14 this date is wrong. &lt;/P&gt;

&lt;P&gt;Could you explain me about that and How to control the configuration ?&lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136120#M184741</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2020-09-28T17:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract timestamp in Mysql database column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136121#M184742</link>
      <description>&lt;P&gt;Hello, is the column rental_date a DATETIME data type? If not perhaps you could add a CAST to your SELECT. The documentation seems to indicate that DBX likes timestamp columns to be of this type.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2014 21:04:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136121#M184742</guid>
      <dc:creator>chanfoli</dc:creator>
      <dc:date>2014-07-09T21:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract timestamp in Mysql database column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136122#M184743</link>
      <description>&lt;P&gt;Hi chanfoli, &lt;/P&gt;

&lt;P&gt;Yes the data type is DATETIME. &lt;/P&gt;

&lt;P&gt;Tks!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2014 21:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136122#M184743</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2014-07-09T21:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract timestamp in Mysql database column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136123#M184744</link>
      <description>&lt;P&gt;Did you try with the default (leaving the format field blank)? I am pretty sure the default recognizes the standard timestamp format.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2014 21:33:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136123#M184744</guid>
      <dc:creator>chanfoli</dc:creator>
      <dc:date>2014-07-09T21:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract timestamp in Mysql database column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136124#M184745</link>
      <description>&lt;P&gt;Yes, I did. &lt;/P&gt;

&lt;P&gt;input type: Tail &lt;BR /&gt;
database: sakali &lt;BR /&gt;
x Specify SQL Query: select * from rental {{WHERE $rising_column$ &amp;gt; ?}}&lt;BR /&gt;
rissing_collumn: rental_id&lt;BR /&gt;
sourcetype: database-sakali&lt;BR /&gt;
index: main&lt;BR /&gt;
host: serverbd&lt;/P&gt;

&lt;P&gt;Output Format : key-value format&lt;BR /&gt;
Timestamp column: rental_date&lt;BR /&gt;
Timestamp format:&lt;BR /&gt;
interval: auto&lt;/P&gt;

&lt;P&gt;There is a result:&lt;/P&gt;

&lt;P&gt;Splunk Timestamp                       event&lt;BR /&gt;
7/9/14 11:59:57.000 PM ||   2005-06-20T23:59:57.000 rental_id=3194 inventory_id=1835 customer_id=432 (..)&lt;/P&gt;

&lt;P&gt;any idea?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:01:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136124#M184745</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2020-09-28T17:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract timestamp in Mysql database column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136125#M184746</link>
      <description>&lt;P&gt;You could edit you dbx/local/inputs.conf and add the option:&lt;/P&gt;

&lt;P&gt;output.timestamp.parse.format, something like:&lt;/P&gt;

&lt;P&gt;output.timestamp.parse.format = yyyy-MM-dd'T'HH:mm:ss.SSS&lt;BR /&gt;
Format reference: &lt;A href="http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html"&gt;http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2014 05:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136125#M184746</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-07-10T05:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do you extract timestamp in Mysql database column?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136126#M184747</link>
      <description>&lt;P&gt;Hey musskopf, &lt;/P&gt;

&lt;P&gt;I did, but not works. &lt;BR /&gt;
First I edited the ...dbx\local\inputs.conf&lt;/P&gt;

&lt;P&gt;[dbmon-tail://sakila/teste-splunk]&lt;BR /&gt;
host = testesplunk&lt;BR /&gt;
index = main&lt;BR /&gt;
output.format = kv&lt;BR /&gt;
output.timestamp = 1&lt;BR /&gt;
output.timestamp.column = rental_date&lt;BR /&gt;
output.timestamp.parse.format = yyyy-MM-dd'T'HH:mm:ss.SSS&lt;BR /&gt;
query = select * from rental {{WHERE $rising_column$ &amp;gt; ?}}&lt;BR /&gt;
sourcetype = testesplunk&lt;BR /&gt;
tail.rising.column = rental_id&lt;/P&gt;

&lt;P&gt;Then I restarted the splunkd service. &lt;/P&gt;

&lt;P&gt;Timestamp splunk        ||  events &lt;BR /&gt;
7/9/14 11:59:57.000 PM       2005-06-20T23:59:57.000 rental_id=31(..)&lt;/P&gt;

&lt;P&gt;The correct date is 2005-06-20.&lt;/P&gt;

&lt;P&gt;any idea?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:02:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-extract-timestamp-in-Mysql-database-column/m-p/136126#M184747</guid>
      <dc:creator>dfigurello</dc:creator>
      <dc:date>2020-09-28T17:02:06Z</dc:date>
    </item>
  </channel>
</rss>

