<?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: rename command is changing time format in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563576#M196339</link>
    <description>&lt;P&gt;Good spot, cheers&lt;/P&gt;</description>
    <pubDate>Tue, 17 Aug 2021 03:00:07 GMT</pubDate>
    <dc:creator>shakSplunk</dc:creator>
    <dc:date>2021-08-17T03:00:07Z</dc:date>
    <item>
      <title>rename command is changing time format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563564#M196331</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a field that has a time value such as (_time field):&lt;/P&gt;&lt;P&gt;2021-08-12 15:18:42&lt;/P&gt;&lt;P&gt;However, when I got to use the rename command on the _time field, it changes the format to:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1628723833&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any assistance in how to NOT make the date format change whilst also renaming the field would be greatly appreciated. &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 00:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563564#M196331</guid>
      <dc:creator>shakSplunk</dc:creator>
      <dc:date>2021-08-17T00:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: rename command is changing time format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563568#M196333</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234998"&gt;@shakSplunk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_time is an epoch value internally, but splunkweb provides default formatting for _time. That formatting is lost if you rename the field.&lt;/P&gt;&lt;P&gt;You can restore formatting in tables with fieldformat:&lt;/P&gt;&lt;P&gt;| rename _time as t&lt;BR /&gt;| fieldformat t=strftime(t, "%F %T")&lt;/P&gt;&lt;P&gt;If you want to treat t as a string, you can convert the value:&lt;/P&gt;&lt;P&gt;| eval t=strftime(t, "%F %T")&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 00:42:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563568#M196333</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-08-17T00:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: rename command is changing time format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563573#M196337</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/49493"&gt;@tscroggins&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the answer! It works when the rename label is one word however when there are whitespaces, it doesn't seem to work. E.g.&lt;/P&gt;&lt;P&gt;| rename _time as "Latest Log Timestamp"&lt;BR /&gt;| fieldformat 'Latest Log Timestamp'=strftime(t, "%F %T")&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 02:48:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563573#M196337</guid>
      <dc:creator>shakSplunk</dc:creator>
      <dc:date>2021-08-17T02:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: rename command is changing time format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563575#M196338</link>
      <description>&lt;P&gt;You left 't' in the strftime. Your statements should be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| fieldformat "Latest Log Timestamp"=strftime('Latest Log Timestamp', "%F %T")&lt;/LI-CODE&gt;&lt;P&gt;i.e. double quotes on the left hand side and single quotes on the right hand side&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 02:57:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563575#M196338</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-08-17T02:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: rename command is changing time format</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563576#M196339</link>
      <description>&lt;P&gt;Good spot, cheers&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 03:00:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rename-command-is-changing-time-format/m-p/563576#M196339</guid>
      <dc:creator>shakSplunk</dc:creator>
      <dc:date>2021-08-17T03:00:07Z</dc:date>
    </item>
  </channel>
</rss>

