<?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 use regex to select a string between two symbols? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616390#M214227</link>
    <description>&lt;P&gt;Yes..seems like I am looking for rex not regex. Thanks for helping.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 21:38:51 GMT</pubDate>
    <dc:creator>ss394546910</dc:creator>
    <dc:date>2022-10-07T21:38:51Z</dc:date>
    <item>
      <title>How do I use regex to select a string between two symbols?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616377#M214222</link>
      <description>&lt;P&gt;Splunk logs looks like below:&lt;/P&gt;&lt;P&gt;userid=234user|rwe23|dwdwd --&lt;/P&gt;&lt;P&gt;userid=id123|34lod|2323 textHow can I get value between "=" and first "|"&lt;/P&gt;&lt;P&gt;I want to get table of value between "=" and first "|", like "234user" and "id123"&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;index=indexhere "userid=" |regex "(?&amp;lt;==)(?&amp;lt;info&amp;gt;.+?)(?=\|)"&lt;BR /&gt;| dedup info&lt;BR /&gt;| table info&lt;/P&gt;&lt;P&gt;this one works fine in regex101, but shows 0 result in Splunk.&lt;BR /&gt;Could anyone please help?&amp;nbsp;&lt;SPAN&gt;Any help would be appreciated. Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 20:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616377#M214222</guid>
      <dc:creator>ss394546910</dc:creator>
      <dc:date>2022-10-07T20:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use regex to select a string between two symbols?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616384#M214225</link>
      <description>&lt;P&gt;The regex command filters events - it does not extract fields.&amp;nbsp; To extract fields, use the rex command.&amp;nbsp; Also, avoid lookbehind in regexes - they're not necessary and take longer to process.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexhere "userid=" 
| rex "userid=(?&amp;lt;info&amp;gt;[^\|]+?)"
| dedup info
| table info&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Oct 2022 21:10:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616384#M214225</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-10-07T21:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use regex to select a string between two symbols?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616385#M214226</link>
      <description>&lt;P&gt;Despite closeness in name, regex and rex are two very different commands. &amp;nbsp;From&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Regex#regex" target="_blank" rel="noopener"&gt;regex&lt;/A&gt;:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;H1&gt;&lt;SPAN class=""&gt;regex&lt;/SPAN&gt;&lt;/H1&gt;&lt;H2&gt;&lt;SPAN class=""&gt;Description&lt;/SPAN&gt;&lt;/H2&gt;&lt;P&gt;Removes results that match or do not match the specified regular expression.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think you are looking for&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rex" target="_blank" rel="noopener"&gt;rex&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexhere "userid="
|rex "=(?&amp;lt;info&amp;gt;[^|]+)"
| dedup info
| table info&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 21:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616385#M214226</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-10-07T21:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use regex to select a string between two symbols?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616390#M214227</link>
      <description>&lt;P&gt;Yes..seems like I am looking for rex not regex. Thanks for helping.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 21:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-regex-to-select-a-string-between-two-symbols/m-p/616390#M214227</guid>
      <dc:creator>ss394546910</dc:creator>
      <dc:date>2022-10-07T21:38:51Z</dc:date>
    </item>
  </channel>
</rss>

