<?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 How to change the date format if query MySQ data base in DB connect. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120755#M184050</link>
    <description>&lt;P&gt;After query MySQL data base in DB connect, the date is number, how to make it as "YYYY-MM-DD HH-MM-SS"?&lt;/P&gt;</description>
    <pubDate>Thu, 11 Sep 2014 09:05:10 GMT</pubDate>
    <dc:creator>felix_fxm</dc:creator>
    <dc:date>2014-09-11T09:05:10Z</dc:date>
    <item>
      <title>How to change the date format if query MySQ data base in DB connect.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120755#M184050</link>
      <description>&lt;P&gt;After query MySQL data base in DB connect, the date is number, how to make it as "YYYY-MM-DD HH-MM-SS"?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2014 09:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120755#M184050</guid>
      <dc:creator>felix_fxm</dc:creator>
      <dc:date>2014-09-11T09:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the date format if query MySQ data base in DB connect.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120756#M184051</link>
      <description>&lt;P&gt;Hi Felix,&lt;/P&gt;

&lt;P&gt;if your date is an epoch timestamp, you can use the strftime command to convert it. Assume time_epoch is your date as number, then:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval date=strftime(time_epoch, "%F %T")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Greetings&lt;/P&gt;

&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2014 10:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120756#M184051</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2014-09-11T10:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the date format if query MySQ data base in DB connect.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120757#M184052</link>
      <description>&lt;P&gt;Hi. You can also try using an SQL statement in your query that converts epoch time to datetime. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SELECT FROM_UNIXTIME(epoch timestamp, optional output format)
The default output is YYYY-MM-DD HH:MM:SS
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Sep 2014 18:23:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120757#M184052</guid>
      <dc:creator>sroback_splunk</dc:creator>
      <dc:date>2014-09-11T18:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the date format if query MySQ data base in DB connect.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120758#M184053</link>
      <description>&lt;P&gt;Thanks Tom and Sroback! I have tried both, but failed. Following is my search command.&lt;/P&gt;

&lt;P&gt;| dbquery WAS_Dev limit=1000 "select * from wsa_db.metering left join (wsa_db.user)\n   on (wsa_db.user.Oxygen_Id=wsa_db.metering.Oxygen_Id)"|eval date=strftime(time_epoch, "%F %T")&lt;/P&gt;

&lt;P&gt;But the column of “Start_Time” is still a number, such as "1402012699.000".&lt;BR /&gt;
Type of this column_name is "Date_Time".&lt;/P&gt;

&lt;P&gt;Is there some problem with my search command?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:34:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120758#M184053</guid>
      <dc:creator>felix_fxm</dc:creator>
      <dc:date>2020-09-28T17:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the date format if query MySQ data base in DB connect.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120759#M184054</link>
      <description>&lt;P&gt;Hi Tom, You might want to have a look at this documentation about timestamps and dboutput in DB Connect:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/DBX/latest/DeployDBX/Configuredatabasemonitoring#About_timestamps_and_database_output"&gt;http://docs.splunk.com/Documentation/DBX/latest/DeployDBX/Configuredatabasemonitoring#About_timestamps_and_database_output&lt;/A&gt;&lt;BR /&gt;
Make sure to review the section on "Timestamp best practices." In case you are using timestamp as rising column, it is not recommended. &lt;/P&gt;

&lt;P&gt;Also, you might want to review this Search Reference doc to make sure you are using proper syntax for the "eval" command:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2014 20:14:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-date-format-if-query-MySQ-data-base-in-DB/m-p/120759#M184054</guid>
      <dc:creator>sroback_splunk</dc:creator>
      <dc:date>2014-09-16T20:14:41Z</dc:date>
    </item>
  </channel>
</rss>

