<?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 Regex: Simple Substring for Field Extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-Simple-Substring-for-Field-Extraction/m-p/50866#M12231</link>
    <description>&lt;P&gt;Hi All&lt;/P&gt;

&lt;P&gt;I seem to be having a little issue extracting data from a specific position, the data I am working with have fields that start and end at a specific character position. The automatic generator does a good job but seems to miss some data and therefore would simply like to add fields based on character position. For Example:&lt;/P&gt;

&lt;P&gt;Data:&lt;/P&gt;

&lt;P&gt;27/07/11 18:59     209 03 0014111111190*A                &lt;STRONG&gt;00:05&lt;/STRONG&gt;'36&lt;BR /&gt;&lt;BR /&gt;
27/07/11 19:18     209 03 00141111119906                 &lt;STRONG&gt;00:18&lt;/STRONG&gt;'15&lt;BR /&gt;&lt;BR /&gt;
27/07/11 22:14     224 03 00117111141136                 &lt;STRONG&gt;00:09&lt;/STRONG&gt;'01               &lt;/P&gt;

&lt;P&gt;I would like to extract the data in bold (substring 58-62)&lt;/P&gt;

&lt;P&gt;Can this be done simple?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:46:02 GMT</pubDate>
    <dc:creator>talismanc</dc:creator>
    <dc:date>2020-09-28T09:46:02Z</dc:date>
    <item>
      <title>Regex: Simple Substring for Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Simple-Substring-for-Field-Extraction/m-p/50866#M12231</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;

&lt;P&gt;I seem to be having a little issue extracting data from a specific position, the data I am working with have fields that start and end at a specific character position. The automatic generator does a good job but seems to miss some data and therefore would simply like to add fields based on character position. For Example:&lt;/P&gt;

&lt;P&gt;Data:&lt;/P&gt;

&lt;P&gt;27/07/11 18:59     209 03 0014111111190*A                &lt;STRONG&gt;00:05&lt;/STRONG&gt;'36&lt;BR /&gt;&lt;BR /&gt;
27/07/11 19:18     209 03 00141111119906                 &lt;STRONG&gt;00:18&lt;/STRONG&gt;'15&lt;BR /&gt;&lt;BR /&gt;
27/07/11 22:14     224 03 00117111141136                 &lt;STRONG&gt;00:09&lt;/STRONG&gt;'01               &lt;/P&gt;

&lt;P&gt;I would like to extract the data in bold (substring 58-62)&lt;/P&gt;

&lt;P&gt;Can this be done simple?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;

&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:46:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Simple-Substring-for-Field-Extraction/m-p/50866#M12231</guid>
      <dc:creator>talismanc</dc:creator>
      <dc:date>2020-09-28T09:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: Simple Substring for Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Simple-Substring-for-Field-Extraction/m-p/50867#M12232</link>
      <description>&lt;P&gt;Does this work for you?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\s+(?&amp;lt;myfield&amp;gt;\d+:\d+)\'\d+$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jul 2011 14:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Simple-Substring-for-Field-Extraction/m-p/50867#M12232</guid>
      <dc:creator>mw</dc:creator>
      <dc:date>2011-07-30T14:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: Simple Substring for Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Simple-Substring-for-Field-Extraction/m-p/50868#M12233</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Thanks for the reply, i tried that and just got a syntax error.&lt;/P&gt;

&lt;P&gt;I have now managed to solve it, i steered clear of just trying to grab the nth to nth character and created the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)^\d+/\d+/\d+\s+\d+:\d+\s+\d+\s+\d+\s+\S+\s+(?P&amp;lt;Duration_Mins2&amp;gt;[^']+) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because sometimes my PBX spat out text and special characters in the Phone Number field it was messing with Splunks Generate capability.&lt;/P&gt;

&lt;P&gt;Seems rather simple when i actually stood back and looked at it!!&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jul 2011 16:54:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Simple-Substring-for-Field-Extraction/m-p/50868#M12233</guid>
      <dc:creator>talismanc</dc:creator>
      <dc:date>2011-07-30T16:54:23Z</dc:date>
    </item>
  </channel>
</rss>

