<?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: Extract date and time from a message in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297492#M89775</link>
    <description>&lt;P&gt;Hey @sravani27, did either of these solutions work for you?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Aug 2017 23:10:10 GMT</pubDate>
    <dc:creator>lfedak_splunk</dc:creator>
    <dc:date>2017-08-25T23:10:10Z</dc:date>
    <item>
      <title>Extract date and time from a message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297489#M89772</link>
      <description>&lt;P&gt;Hi I am trying to extract the date and time from the field "message". It gives me everything after the date and time. I don't want the text after the time.&lt;BR /&gt;
&lt;STRONG&gt;message&lt;/STRONG&gt;&lt;BR /&gt;
PubAck Packet sent to device 1234A and 12345678910FC at 08-21-2017 22:09:48.401.&lt;BR /&gt;
Publish message received at 08-21-2017 18:50:04.841 for this service.&lt;BR /&gt;
&lt;STRONG&gt;Required Output&lt;/STRONG&gt;&lt;BR /&gt;
08-21-2017 22:09:48.401&lt;BR /&gt;
08-21-2017 18:50:04.841&lt;BR /&gt;
&lt;STRONG&gt;My regex&lt;/STRONG&gt;&lt;BR /&gt;
rex field=message "at(?.+)"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;My result&lt;/STRONG&gt;&lt;BR /&gt;
08-21-2017 22:09:48.401.&lt;BR /&gt;
08-21-2017 18:50:04.841 for this service.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 17:41:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297489#M89772</guid>
      <dc:creator>sravani27</dc:creator>
      <dc:date>2017-08-22T17:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date and time from a message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297490#M89773</link>
      <description>&lt;P&gt;Try this. The fieldname will be &lt;CODE&gt;time&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | rex \sat\s(?&amp;lt;time&amp;gt;\d+\-\d+\-\d+\s\d+:\d+:\d+\.\d+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 18:24:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297490#M89773</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2017-08-22T18:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date and time from a message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297491#M89774</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval message="Publish message received at 08-21-2017 18:50:04.841 for this service." | rex field=message "at\s+(?P&amp;lt;datetime&amp;gt;\S+\s+\S+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Aug 2017 18:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297491#M89774</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-08-22T18:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract date and time from a message</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297492#M89775</link>
      <description>&lt;P&gt;Hey @sravani27, did either of these solutions work for you?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 23:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-date-and-time-from-a-message/m-p/297492#M89775</guid>
      <dc:creator>lfedak_splunk</dc:creator>
      <dc:date>2017-08-25T23:10:10Z</dc:date>
    </item>
  </channel>
</rss>

