<?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: regex substr help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567420#M197736</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225094"&gt;@mcaulsc&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| eval BB=substr(your_field,5,2)
| table _time BB&lt;/LI-CODE&gt;&lt;P&gt;or using a regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| rex field=your_field "\w{4}(?&amp;lt;BB&amp;gt;\w{2})\w{2"}
| table _time BB&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 17 Sep 2021 13:43:52 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-09-17T13:43:52Z</dc:date>
    <item>
      <title>regex substr help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567415#M197734</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;in anything else this would seem very simple but I seem to be flummoxed trying to do this in splunk. Probably not helped by having zero regex knowledge.&lt;/P&gt;&lt;P&gt;I have a field that has values in the format:&amp;nbsp; AAAABBCC&lt;/P&gt;&lt;P&gt;I want to return all values that have BB in position 5, if anyone could be so kind as to&amp;nbsp; provide a sample I can then pull it apart and try and work out how it does it.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:35:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567415#M197734</guid>
      <dc:creator>mcaulsc</dc:creator>
      <dc:date>2021-09-17T13:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: regex substr help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567420#M197736</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225094"&gt;@mcaulsc&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| eval BB=substr(your_field,5,2)
| table _time BB&lt;/LI-CODE&gt;&lt;P&gt;or using a regex:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| rex field=your_field "\w{4}(?&amp;lt;BB&amp;gt;\w{2})\w{2"}
| table _time BB&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:43:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567420#M197736</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-17T13:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: regex substr help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567423#M197739</link>
      <description>&lt;P&gt;Assuming characters 1-4=A 5-6=B and 7-8=C, the following should work:&lt;BR /&gt;&lt;BR /&gt;| rex field=YourField "(?&amp;lt;A_values&amp;gt;....)(?&amp;lt;B_values&amp;gt;..)(?&amp;lt;C_values&amp;gt;..)&lt;BR /&gt;&lt;BR /&gt;You should now have three fields A_values, B_values, and C_values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:45:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567423#M197739</guid>
      <dc:creator>solarboyz1</dc:creator>
      <dc:date>2021-09-17T13:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: regex substr help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567428#M197742</link>
      <description>&lt;P&gt;thanks, that gets me a list of all the possible values in pos 5 for 2. What I want is the whole value if I have a match.&lt;/P&gt;&lt;P&gt;so if I have AAAABBCC I have a match on BB in pos5,2 so return AAAABBCC&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567428#M197742</guid>
      <dc:creator>mcaulsc</dc:creator>
      <dc:date>2021-09-17T13:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: regex substr help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567430#M197743</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225094"&gt;@mcaulsc&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, if you want to search the values "xx" in the fifth and sixth posizion, try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index
| eval BB=substr(your_field,5,2)
| search BB="xx"
| table _time your_field BB&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:53:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567430#M197743</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-17T13:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: regex substr help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567433#M197745</link>
      <description>&lt;P&gt;That's the one, been tying myself in knots with this for far longer than I should and ended up down regex rabbit holes that I didn't need to be down.&lt;BR /&gt;Many thanks for the help.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:57:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567433#M197745</guid>
      <dc:creator>mcaulsc</dc:creator>
      <dc:date>2021-09-17T13:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: regex substr help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567434#M197746</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225094"&gt;@mcaulsc&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see nect time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Sep 2021 13:57:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-substr-help/m-p/567434#M197746</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-09-17T13:57:24Z</dc:date>
    </item>
  </channel>
</rss>

