<?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 Get the specific string from the line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86734#M22118</link>
    <description>&lt;P&gt;Hi, &lt;BR /&gt;
I wanted to know is it possible to get a string at specific location from a line.&lt;/P&gt;

&lt;P&gt;for e.g.&lt;BR /&gt;
My line is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;STEP LOGVAL      error_Func_value/error function value      10:04:06.085         doorstep: get the directive
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I want to show this string "10:04:06.085" as my result.&lt;/P&gt;

&lt;P&gt;Please help.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2013 09:12:48 GMT</pubDate>
    <dc:creator>harshal_chakran</dc:creator>
    <dc:date>2013-10-08T09:12:48Z</dc:date>
    <item>
      <title>Get the specific string from the line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86734#M22118</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I wanted to know is it possible to get a string at specific location from a line.&lt;/P&gt;

&lt;P&gt;for e.g.&lt;BR /&gt;
My line is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;STEP LOGVAL      error_Func_value/error function value      10:04:06.085         doorstep: get the directive
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I want to show this string "10:04:06.085" as my result.&lt;/P&gt;

&lt;P&gt;Please help.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2013 09:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86734#M22118</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2013-10-08T09:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get the specific string from the line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86735#M22119</link>
      <description>&lt;P&gt;Is this what your actual log looks like? How are the pieces of information separated? Multiple spaces? tabs?&lt;/P&gt;

&lt;P&gt;Assuming you have a separator of 6 spaces, like in your sample above, you can extract the the time information into a field called TimeStamp like this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "\s{6}(?&amp;lt;TimeStamp&amp;gt;\d\d:\d\d:\d\d\.\d\d\d)\s{6}" | the rest of your search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2013 09:27:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86735#M22119</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-08T09:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get the specific string from the line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86736#M22120</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Thanks for the help.&lt;BR /&gt;
But when I run this query, it highlights only the sourcetype, and what I want is to get that timestamp at output. I have tried to tweak the query, but couldn't succeed. &lt;/P&gt;

&lt;P&gt;And the pieces of information is separated by multiple spaces.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2013 12:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86736#M22120</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2013-10-08T12:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get the specific string from the line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86737#M22121</link>
      <description>&lt;P&gt;"highlights the sourcetype"? I don't understand. Try this, somewhat shorter regex;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...| rex "\s{3,}(?&amp;lt;TimeStamp&amp;gt;[0-9.:]+)\s{3,}" | table TimeStamp&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The last &lt;CODE&gt;table&lt;/CODE&gt; command is just for verification purposes. Remove it if the extraction works.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2013 13:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-specific-string-from-the-line/m-p/86737#M22121</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-10-08T13:24:58Z</dc:date>
    </item>
  </channel>
</rss>

