<?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 extract the month from date field in string? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316665#M94749</link>
    <description>&lt;P&gt;I have a date field in a string with the format as mn/day/year. I need to extract the month from the same. Can someone help on this issue?&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2017 16:33:24 GMT</pubDate>
    <dc:creator>srinadh</dc:creator>
    <dc:date>2017-05-24T16:33:24Z</dc:date>
    <item>
      <title>How to extract the month from date field in string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316665#M94749</link>
      <description>&lt;P&gt;I have a date field in a string with the format as mn/day/year. I need to extract the month from the same. Can someone help on this issue?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 16:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316665#M94749</guid>
      <dc:creator>srinadh</dc:creator>
      <dc:date>2017-05-24T16:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the month from date field in string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316666#M94750</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=YourFieldHere "(^?&amp;lt;Month&amp;gt;[^\/]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 May 2017 16:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316666#M94750</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-24T16:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the month from date field in string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316667#M94751</link>
      <description>&lt;P&gt;The best way I have found to do this is convert field to epoch time, then just pull the month out of that. For example:&lt;/P&gt;

&lt;P&gt;| eval epochField=strptime(field, "%m/%d/%Y")&lt;BR /&gt;
| eval month=strftime(epochField, "%B")&lt;/P&gt;

&lt;P&gt;The syntax will vary somewhat based on the exact format of the date and the exact format you want the month in. Refer to this document: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Commontimeformatvariables"&gt;http://docs.splunk.com/Documentation/Splunk/6.6.0/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 17:13:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316667#M94751</guid>
      <dc:creator>chrishartsock</dc:creator>
      <dc:date>2017-05-24T17:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the month from date field in string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316668#M94752</link>
      <description>&lt;P&gt;you can combine them into one eval, as well. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval month=strftime(strptime(field, "%m/%d/%y"), "%B")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 May 2017 17:42:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-month-from-date-field-in-string/m-p/316668#M94752</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-05-24T17:42:18Z</dc:date>
    </item>
  </channel>
</rss>

