<?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: strftime day and month: Splunk vs Python in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/strftime-day-and-month-Splunk-vs-Python/m-p/515372#M144692</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/171870"&gt;@pm771&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think the Splunk docs are not very detailed about this and could be improved, for sure.&amp;nbsp; I believe it's just python libraries in the Splunk backend so, yes, any valid python strftime() modifiers will work (dependent on the installed Splunk python version).&lt;BR /&gt;&lt;BR /&gt;Here's a run anywhere example I tried.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval epoch=relative_time(_time, "@month")
      ,date1=strftime(relative_time(epoch, "@month"), "%Y-%m-%d")
      ,date2=strftime(relative_time(epoch, "@month"), "%Y-%m-%e")
      ,date3=strftime(relative_time(epoch, "@month"), "%Y-%-m-%-d")
      ,date4=strftime(relative_time(epoch, "@month"), "%Y-%#m-%#d")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note the %e has a leading whitespace so stick to either %-d or %#d.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Aug 2020 06:26:58 GMT</pubDate>
    <dc:creator>yeahnah</dc:creator>
    <dc:date>2020-08-21T06:26:58Z</dc:date>
    <item>
      <title>strftime day and month: Splunk vs Python</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strftime-day-and-month-Splunk-vs-Python/m-p/515331#M144674</link>
      <description>&lt;P&gt;My question is about day and month components of a date without leading zeroes.&lt;BR /&gt;&lt;BR /&gt;Python docs provide&lt;FONT color="#800080"&gt; %-d&lt;/FONT&gt; and &lt;FONT color="#800080"&gt;%-m&lt;/FONT&gt; respectively.&lt;BR /&gt;&lt;BR /&gt;Splunk docs do not show these options.&amp;nbsp; Splunk, however, has &lt;FONT color="#800080"&gt;%e&lt;/FONT&gt; which seems to be the same as &lt;FONT color="#800080"&gt;%-d&lt;/FONT&gt;.&amp;nbsp; I did not find any option for decimal month number.&lt;BR /&gt;&lt;BR /&gt;I have tried and Splunk seems to accept&amp;nbsp;&lt;FONT color="#800080"&gt;%-d&lt;/FONT&gt; and &lt;FONT color="#800080"&gt;%-m&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Is it standard feature that I can rely on? Is it implementation dependent?&lt;BR /&gt;&lt;BR /&gt;Did I miss something in Splunk docs?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 00:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strftime-day-and-month-Splunk-vs-Python/m-p/515331#M144674</guid>
      <dc:creator>pm771</dc:creator>
      <dc:date>2020-08-21T00:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: strftime day and month: Splunk vs Python</title>
      <link>https://community.splunk.com/t5/Splunk-Search/strftime-day-and-month-Splunk-vs-Python/m-p/515372#M144692</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/171870"&gt;@pm771&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I think the Splunk docs are not very detailed about this and could be improved, for sure.&amp;nbsp; I believe it's just python libraries in the Splunk backend so, yes, any valid python strftime() modifiers will work (dependent on the installed Splunk python version).&lt;BR /&gt;&lt;BR /&gt;Here's a run anywhere example I tried.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval epoch=relative_time(_time, "@month")
      ,date1=strftime(relative_time(epoch, "@month"), "%Y-%m-%d")
      ,date2=strftime(relative_time(epoch, "@month"), "%Y-%m-%e")
      ,date3=strftime(relative_time(epoch, "@month"), "%Y-%-m-%-d")
      ,date4=strftime(relative_time(epoch, "@month"), "%Y-%#m-%#d")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Note the %e has a leading whitespace so stick to either %-d or %#d.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2020 06:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/strftime-day-and-month-Splunk-vs-Python/m-p/515372#M144692</guid>
      <dc:creator>yeahnah</dc:creator>
      <dc:date>2020-08-21T06:26:58Z</dc:date>
    </item>
  </channel>
</rss>

