<?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 time manually ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151619#M185540</link>
    <description>&lt;P&gt;What is the query to extract time manually for a span of minute?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2015 14:40:30 GMT</pubDate>
    <dc:creator>moiezuddin</dc:creator>
    <dc:date>2015-04-20T14:40:30Z</dc:date>
    <item>
      <title>How to extract time manually ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151619#M185540</link>
      <description>&lt;P&gt;What is the query to extract time manually for a span of minute?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 14:40:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151619#M185540</guid>
      <dc:creator>moiezuddin</dc:creator>
      <dc:date>2015-04-20T14:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time manually ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151620#M185541</link>
      <description>&lt;P&gt;Hello! Can i get your time format?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 17:42:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151620#M185541</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-04-20T17:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time manually ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151621#M185542</link>
      <description>&lt;P&gt;hi moiezuddin &lt;BR /&gt;
can we have the time format pl&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 19:18:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151621#M185542</guid>
      <dc:creator>juvetm</dc:creator>
      <dc:date>2015-04-20T19:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time manually ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151622#M185543</link>
      <description>&lt;P&gt;Sample Log&lt;/P&gt;

&lt;P&gt;4/20/15 &lt;BR /&gt;
11:47:00.000 PM &lt;BR /&gt;
[04/20/2015][20:47:40.461][2020398512][s3214933/r21][Center realm][][][][][][206450682][][][][][][centerusushwswp222lprd][** Status: Authorized. ][]&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2015 06:34:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151622#M185543</guid>
      <dc:creator>moiezuddin</dc:creator>
      <dc:date>2015-04-21T06:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract time manually ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151623#M185544</link>
      <description>&lt;P&gt;The way I read your question, "extract time manually for a span of minutes" it sounds like you want to include the earliest, and latest span in your search. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah sourcetype=foo earliest="4/20/2015:20:00:00" latest="4/20/2015:20:22:00"|stats count by whatever
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to know how to get Splunk to extract either the first or second timestamp in your log, you will need to decide which one. They seem to be indicating different timezones as the first one is 11pm and the 2nd one is 8pm. So pick one...&lt;/P&gt;

&lt;P&gt;Those are settings that you want to apply in props.conf. In fact, if it is the first one... just add &lt;CODE&gt;LINE_BREAKER=([\r\n]+)\d\/\d{2}\/\d{2}&lt;/CODE&gt; to props.conf under the stanza for this source/sourcetype and Splunk will grab the first one. if you want the second one, then you would add &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt; and  &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt;  which in this case is nice and easy, as it begins with a left square bracket.&lt;/P&gt;

&lt;P&gt;All together it would look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetypename]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)\d\/\d{2}\/\d{2}
TIME_PREFIX = \[
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Apr 2015 06:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-manually/m-p/151623#M185544</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-21T06:53:57Z</dc:date>
    </item>
  </channel>
</rss>

