<?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 Splunk Regular Expression in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492422#M137362</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8846i103D2788186F1E14/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Attached here the list of roles we have. But my regular expression is showing results of only RSI - VPN Users but not all the other roles.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "^[^\)\n]*\)\[(?P\w+\s+\-\s+\w+\s+\w+)]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help me here?&lt;/P&gt;

&lt;P&gt;Entire Query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=juniperindex | rex "(?P\w+\s+\d+)\s+(?P\d+:\d+:\d+)\s?+(?P\d+\.\d+\.\d+\.\d+)\s+(?P\d+-\d+-\d+T\d+:\d+:\d+-\d+:\d+)\s+(?P[[:graph:]]+)\s+\w+:\s+\d+-\d+-\d+\s+\d+:\d+:\d+\s+-\s+\w++\s+-\s+\[(?P\d+\.\d+\.\d+\.\d+)\]\s+(?P\w+)\((?P[[:graph:]]+)\)\[\]\s+-\s+(?P.+)"  | rex "^[^\)\n]*\)\[(?P\w+\s+\-\s+\w+\s+\w+)" | rex "^(?:[^'\n]*'){7}(?P\w+)]" | rex "host\s+\'(?P[[:graph:]]+)\'" | rex "address\s+\'(?P[[:graph:]]+)\'" | rex "for\s+user\s+\'(?P[[:alnum:]]+)\'" | rex "reason\s+\'(?P[[:print:]]+)\'"  | rex "^(?:[^'\n]*'){2}\s+(?P\w+)"  | search status=failed OR status=passed | replace "passed" with successful in status | dedup user_name | table  _time IP MAC user_name  status user_group
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 May 2020 07:10:59 GMT</pubDate>
    <dc:creator>vasuparvatham</dc:creator>
    <dc:date>2020-05-08T07:10:59Z</dc:date>
    <item>
      <title>Splunk Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492422#M137362</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8846i103D2788186F1E14/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Attached here the list of roles we have. But my regular expression is showing results of only RSI - VPN Users but not all the other roles.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "^[^\)\n]*\)\[(?P\w+\s+\-\s+\w+\s+\w+)]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please help me here?&lt;/P&gt;

&lt;P&gt;Entire Query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=juniperindex | rex "(?P\w+\s+\d+)\s+(?P\d+:\d+:\d+)\s?+(?P\d+\.\d+\.\d+\.\d+)\s+(?P\d+-\d+-\d+T\d+:\d+:\d+-\d+:\d+)\s+(?P[[:graph:]]+)\s+\w+:\s+\d+-\d+-\d+\s+\d+:\d+:\d+\s+-\s+\w++\s+-\s+\[(?P\d+\.\d+\.\d+\.\d+)\]\s+(?P\w+)\((?P[[:graph:]]+)\)\[\]\s+-\s+(?P.+)"  | rex "^[^\)\n]*\)\[(?P\w+\s+\-\s+\w+\s+\w+)" | rex "^(?:[^'\n]*'){7}(?P\w+)]" | rex "host\s+\'(?P[[:graph:]]+)\'" | rex "address\s+\'(?P[[:graph:]]+)\'" | rex "for\s+user\s+\'(?P[[:alnum:]]+)\'" | rex "reason\s+\'(?P[[:print:]]+)\'"  | rex "^(?:[^'\n]*'){2}\s+(?P\w+)"  | search status=failed OR status=passed | replace "passed" with successful in status | dedup user_name | table  _time IP MAC user_name  status user_group
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 May 2020 07:10:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492422#M137362</guid>
      <dc:creator>vasuparvatham</dc:creator>
      <dc:date>2020-05-08T07:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492423#M137363</link>
      <description>&lt;P&gt;can you please help me with a single regular expression to cut below format of entries in the log file:&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;Consultants Special Access&lt;BR /&gt;
Contractors Windows Users Special Access&lt;BR /&gt;
PulseSAMRole&lt;BR /&gt;
RSI - GIB Users&lt;BR /&gt;
RSI - IT Desktop Users&lt;BR /&gt;
RSI - ORA Devtrack&lt;BR /&gt;
RSI - VPN ArchiveContractor Users&lt;BR /&gt;
RSI - VPN Contractor Mac Users&lt;BR /&gt;
RSI - VPN Contractor Users&lt;BR /&gt;
RSI - VPN Contractor Users(Pulse)&lt;BR /&gt;
RSI - VPN ITSecurity Users&lt;BR /&gt;
&lt;EM&gt;RSI - VPN Users&lt;/EM&gt;&lt;BR /&gt;
test&lt;BR /&gt;
Users&lt;BR /&gt;
VPN Contractor Pulse&lt;/P&gt;

&lt;P&gt;Many thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 07:47:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492423#M137363</guid>
      <dc:creator>vasuparvatham</dc:creator>
      <dc:date>2020-05-08T07:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492424#M137364</link>
      <description>&lt;P&gt;You can try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(Con.+ess|Pul.+ole|RSI.+|VPN.+ulse|test|Users)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Made a few tweaks with your data here. You can try and test it with more data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://regex101.com/r/NFBLP2/1" target="test_blank"&gt;https://regex101.com/r/NFBLP2/1&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if it helps.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2020 10:59:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492424#M137364</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2020-05-08T10:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492425#M137365</link>
      <description>&lt;P&gt;thank you.&lt;/P&gt;

&lt;P&gt;Can you please help me with the syntax for creating a tab called "user_group" and include this regular expression?&lt;/P&gt;

&lt;P&gt;ex: | rex  &lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 09:20:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492425#M137365</guid>
      <dc:creator>vasuparvatham</dc:creator>
      <dc:date>2020-05-13T09:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492426#M137366</link>
      <description>&lt;P&gt;Maybe this can help:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "(?&amp;lt;user_group&amp;gt;^(Con.+ess|Pul.+ole|RSI.+|VPN.+ulse|test|Users)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 May 2020 09:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492426#M137366</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2020-05-13T09:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492427#M137367</link>
      <description>&lt;P&gt;i will try this today and come back in case of any queries. thanks lot.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 09:55:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492427#M137367</guid>
      <dc:creator>vasuparvatham</dc:creator>
      <dc:date>2020-05-13T09:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regular Expression</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492428#M137368</link>
      <description>&lt;P&gt;No worries. If it worked, please accept this as the answer, so that it may help others in the future, should they run into a similar kind of issue.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:42:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regular-Expression/m-p/492428#M137368</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2020-05-14T11:42:05Z</dc:date>
    </item>
  </channel>
</rss>

