<?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: How to convert my time field for use in a timechart search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-my-time-field-for-use-in-a-timechart-search/m-p/158406#M44626</link>
    <description>&lt;P&gt;Just to make a tweak to your regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "Contract\s+(?P&amp;lt;CONTRACT&amp;gt;.+\s+expires on\s+)(?P&amp;lt;EXPIRES&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This cleanup will not put "expires" in the CONTRACT, prevent misparsing of the CONTRACT name (if there is "on" in the name), and eliminate the space at the front of EXPIRES.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Question: what result do you get from your dysfunctional query?&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2015 00:23:06 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2015-02-24T00:23:06Z</dc:date>
    <item>
      <title>How to convert my time field for use in a timechart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-my-time-field-for-use-in-a-timechart-search/m-p/158405#M44625</link>
      <description>&lt;P&gt;Any suggestions on how to timechart an unusual timestamp that comes inside the log entry.&lt;BR /&gt;&lt;BR /&gt;
These logs come in every night at midnight.&lt;BR /&gt;&lt;BR /&gt;
I want to run a scheduled search at 6pm that same day every day which &lt;STRONG&gt;charts&lt;/STRONG&gt; the 'EXPIRES' field below as Time by CONTRACT&lt;/P&gt;

&lt;P&gt;Here's the functional stats query: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=contracts | rex "(?i)Contract (?P&amp;lt;CONTRACT&amp;gt;.*on+)(?P&amp;lt;EXPIRES&amp;gt;.*)" | stats count by CONTRACT, EXPIRES
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;log example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Contract Honda Civic 144433 expires on Sun Feb 23 21:16:55 2015 GMT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's the EXPIRES field value that i would like to timechart:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sun Nov 2 21:16:55 2014 GMT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Dysfunctional timechart search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=contracts | rex "(?i)contract (?P&amp;lt;CONTRACT&amp;gt;.*on+)(?P&amp;lt;EXPIRES&amp;gt;.*)" | timechart EXPIRES AS _time by CONTRACT
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Feb 2015 00:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-my-time-field-for-use-in-a-timechart-search/m-p/158405#M44625</guid>
      <dc:creator>subtrakt</dc:creator>
      <dc:date>2015-02-24T00:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert my time field for use in a timechart search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-my-time-field-for-use-in-a-timechart-search/m-p/158406#M44626</link>
      <description>&lt;P&gt;Just to make a tweak to your regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "Contract\s+(?P&amp;lt;CONTRACT&amp;gt;.+\s+expires on\s+)(?P&amp;lt;EXPIRES&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This cleanup will not put "expires" in the CONTRACT, prevent misparsing of the CONTRACT name (if there is "on" in the name), and eliminate the space at the front of EXPIRES.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Question: what result do you get from your dysfunctional query?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 00:23:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-my-time-field-for-use-in-a-timechart-search/m-p/158406#M44626</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2015-02-24T00:23:06Z</dc:date>
    </item>
  </channel>
</rss>

