<?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 do I extract part of my sample log file? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285103#M86228</link>
    <description>&lt;P&gt;I don't see a colon ":" before the time in the data (as you'd see with Elapsed Time). So probably just remove that. Also, for Elapsed time there was only time part with no spaces in between, so you'd need a different rex for this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex field=_raw "Job Completed at\s+(?&amp;lt;completion_time&amp;gt;\d+\/\d+\/\d+\s+\d+:\d+:\d+\s+\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Feb 2016 20:49:35 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-02-11T20:49:35Z</dc:date>
    <item>
      <title>How do I extract part of my sample log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285100#M86225</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;From the below portion of the log file, I want to display only the &lt;CODE&gt;Elapsed Time: 01:05:22.0348974&lt;/CODE&gt;.&lt;BR /&gt;
Can you pls help me with this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;-- 2/6/2016 11:02:42 AM
  Setup Completed
  Elapsed Time: 01:05:22.0348974
Setup Complete
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tried most of the suggested rex, but no luck:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "S(?&amp;lt;Elpased&amp;gt;\w*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Feb 2016 22:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285100#M86225</guid>
      <dc:creator>deenadp</dc:creator>
      <dc:date>2016-02-09T22:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract part of my sample log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285101#M86226</link>
      <description>&lt;P&gt;Assuming the file is already indexed in Splunk, try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=_raw "Elapsed Time:\s(?&amp;lt;elapsed_time&amp;gt;[^ \n\r]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Note: there's a space before &lt;CODE&gt;\n\r&lt;/CODE&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2016 23:57:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285101#M86226</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2016-02-09T23:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract part of my sample log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285102#M86227</link>
      <description>&lt;P&gt;Hi , I was able to fetch the Elapsed time as above but when I try the same for completion time, it doesn't display anything. pls advise If I need to change anything&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Job Completed at 2/10/2016 12:10:26 PM&lt;BR /&gt;
Elapsed Time:&lt;BR /&gt;&lt;BR /&gt;
00:09:43.7907662 Kernel mode CPU Time:&lt;BR /&gt;
00:00:13.2181970 User mode CPU Time:&lt;BR /&gt;&lt;BR /&gt;
00:00:38.9404230 Total page faults:&lt;BR /&gt;&lt;BR /&gt;
4631&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "Job Completed at :\s(?&amp;lt;completion_time&amp;gt;[^ \n\r]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Feb 2016 20:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285102#M86227</guid>
      <dc:creator>deenadp</dc:creator>
      <dc:date>2016-02-11T20:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract part of my sample log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285103#M86228</link>
      <description>&lt;P&gt;I don't see a colon ":" before the time in the data (as you'd see with Elapsed Time). So probably just remove that. Also, for Elapsed time there was only time part with no spaces in between, so you'd need a different rex for this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex field=_raw "Job Completed at\s+(?&amp;lt;completion_time&amp;gt;\d+\/\d+\/\d+\s+\d+:\d+:\d+\s+\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Feb 2016 20:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285103#M86228</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-11T20:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract part of my sample log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285104#M86229</link>
      <description>&lt;P&gt;sorry for the typo above. Below is the once I tried&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;  | rex field=_raw "Job Completed at
&amp;gt; \s(?&amp;lt;completion_time&amp;gt;[^ \n\r]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this shows the completion_time column  but null values are in it... any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 21:01:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285104#M86229</guid>
      <dc:creator>deenadp</dc:creator>
      <dc:date>2016-02-11T21:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract part of my sample log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285105#M86230</link>
      <description>&lt;P&gt;Another issue with your regex is that you've written both a space " " and \s (that's space too) after "at", but your data has just 1 space. Did you try the one I posted?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 21:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285105#M86230</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-11T21:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract part of my sample log file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285106#M86231</link>
      <description>&lt;P&gt;Yes, it worked smoothly.. Cool!!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 22:44:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-part-of-my-sample-log-file/m-p/285106#M86231</guid>
      <dc:creator>deenadp</dc:creator>
      <dc:date>2016-02-11T22:44:18Z</dc:date>
    </item>
  </channel>
</rss>

