<?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: Time format in DB query result in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179981#M98365</link>
    <description>&lt;P&gt;I tried using fieldformat option but facing some problem. This is the query i am running&lt;/P&gt;

&lt;P&gt;... | fieldformat "OPEN_TIME"=strftime('Open time', "%m-%d-%y")&lt;/P&gt;

&lt;P&gt;The result for Open_time field coming up as blank now,&lt;/P&gt;

&lt;P&gt;Anything i am doing wrong here??&lt;/P&gt;</description>
    <pubDate>Tue, 17 Dec 2013 10:10:48 GMT</pubDate>
    <dc:creator>anoopambli</dc:creator>
    <dc:date>2013-12-17T10:10:48Z</dc:date>
    <item>
      <title>Time format in DB query result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179977#M98361</link>
      <description>&lt;P&gt;I am using splunk DB connect to pull out some data to create a dashboard. But having difficulty in getting the time format corrected in search result. The time format looks like in seconds, how do i convert them to Date-Month-year format. Below is the sample of search result, i am trying to get Creation_field and last_update_field time format adjusted.&lt;/P&gt;

&lt;P&gt;CREATION_DATE   DESCRIPTION                            LAST_UPDATE_DATE USERNAME &lt;BR /&gt;
1384405200  xnje411 server monitoring addition  1385010000  Melvin Bolden (a056648)&lt;BR /&gt;
1384318800  snjw100 server monitoring addition  1385960400  Melvin Bolden (a056648)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:29:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179977#M98361</guid>
      <dc:creator>anoopambli</dc:creator>
      <dc:date>2020-09-28T15:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Time format in DB query result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179978#M98362</link>
      <description>&lt;P&gt;Hi, you probably just need to make sure that Splunk recognizes that's a time. Here's some tips: &lt;A href="http://docs.splunk.com/Documentation/DBX/1.1.1/DeployDBX/Configuredatabasemonitoring#About_timestamps_and_database_output"&gt;http://docs.splunk.com/Documentation/DBX/1.1.1/DeployDBX/Configuredatabasemonitoring#About_timestamps_and_database_output&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2013 17:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179978#M98362</guid>
      <dc:creator>jcoates_splunk</dc:creator>
      <dc:date>2013-12-16T17:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Time format in DB query result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179979#M98363</link>
      <description>&lt;P&gt;Look at the convert command:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/convert"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/convert&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Or look at the eval function strftime:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2013 17:26:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179979#M98363</guid>
      <dc:creator>aholzer</dc:creator>
      <dc:date>2013-12-16T17:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Time format in DB query result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179980#M98364</link>
      <description>&lt;P&gt;You can try to use the | fieldformat command (similar to eval, but applies at field rendering time, so that sort still works correctly) and the strftime() function. For example: &lt;/P&gt;

&lt;P&gt;... | fieldformat Creation_field = strftime(Creation_field, “%m-%d-%y”)&lt;/P&gt;

&lt;P&gt;See: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldformat#Examples" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Fieldformat#Examples&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:29:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179980#M98364</guid>
      <dc:creator>sroback_splunk</dc:creator>
      <dc:date>2020-09-28T15:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Time format in DB query result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179981#M98365</link>
      <description>&lt;P&gt;I tried using fieldformat option but facing some problem. This is the query i am running&lt;/P&gt;

&lt;P&gt;... | fieldformat "OPEN_TIME"=strftime('Open time', "%m-%d-%y")&lt;/P&gt;

&lt;P&gt;The result for Open_time field coming up as blank now,&lt;/P&gt;

&lt;P&gt;Anything i am doing wrong here??&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2013 10:10:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179981#M98365</guid>
      <dc:creator>anoopambli</dc:creator>
      <dc:date>2013-12-17T10:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Time format in DB query result</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179982#M98366</link>
      <description>&lt;P&gt;I was able to fix it by using convert command convert timeformat="%b %d, %Y" ctime(OPEN_TIME) AS Open-Date&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2013 15:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Time-format-in-DB-query-result/m-p/179982#M98366</guid>
      <dc:creator>anoopambli</dc:creator>
      <dc:date>2013-12-17T15:05:11Z</dc:date>
    </item>
  </channel>
</rss>

