<?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: Help building regex for searches based on cs_username field. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-building-regex-for-searches-based-on-cs-username-field/m-p/501621#M139654</link>
    <description>&lt;P&gt;Hi @Vfinney,&lt;BR /&gt;
try the following regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^\d+-\d+-\d+\s+\d+:\d+:\d+\s+\d+\.\d+\.\d+\.\d+\s+\w+\s\/[^ ]+\s+[^ ]+\s+\d+\s+(?&amp;lt;cs_username&amp;gt;[^ ]+)\s+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or using the rex command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| rex "^\d+-\d+-\d+\s+\d+:\d+:\d+\s+\d+\.\d+\.\d+\.\d+\s+\w+\s\/[^ ]+\s+[^ ]+\s+\d+\s+(?&amp;lt;cs_username&amp;gt;[^ ]+)\s+"
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that you can test at &lt;A href="https://regex101.com/r/xyPcQj/1"&gt;https://regex101.com/r/xyPcQj/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2020 21:53:42 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2020-05-20T21:53:42Z</dc:date>
    <item>
      <title>Help building regex for searches based on cs_username field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-building-regex-for-searches-based-on-cs-username-field/m-p/501619#M139652</link>
      <description>&lt;P&gt;I'm having no luck building a regex to match  &lt;CODE&gt;cs_usernames&lt;/CODE&gt;.  What I'm looking for are two separate searches both based on the &lt;BR /&gt;
 &lt;CODE&gt;cs_username&lt;/CODE&gt; field.  The first search is to find all instances where the usernames are in all CAPS. The second search is to find usernames that end in at least two digits. Example of logs are below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2020-05-15 04:58:34 10.140.14.228 POST /NotAvailable.aspx - 80 Gerardot 10.140.15.235 Mozilla/5.0+(Linux;+Android+9;+SM-G960U)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/74.0.3729.136+Mobile+Safari/537.36  302 0 0 15 172.69.69.111

2020-05-15 04:57:19 10.140.14.228 POST /Account/Login.aspx - 80 Kaitlyn1230 10.140.15.235 Mozilla/5.0+(iPhone;+CPU+iPhone+OS+13_4+like+Mac+OS+X)+AppleWebKit/605.1.15+(KHTML,+like+Gecko)+GSA/107.0.310639584+Mobile/15E148+Safari/604.1 200 0 0 46 162.158.75.109

2020-05-15 04:54:24 10.140.14.228 POST /PaymentInfo.aspx - 80 Emulbah 10.140.15.235 Mozilla/5.0+(Windows+NT+6.1;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/81.0.4044.138+Safari/537.36  302 0 0 46 172.68.150.39
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 May 2020 18:48:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-building-regex-for-searches-based-on-cs-username-field/m-p/501619#M139652</guid>
      <dc:creator>Vfinney</dc:creator>
      <dc:date>2020-05-20T18:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help building regex for searches based on cs_username field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-building-regex-for-searches-based-on-cs-username-field/m-p/501620#M139653</link>
      <description>&lt;P&gt;your log is space delimited.&lt;/P&gt;

&lt;P&gt;why do not you use &lt;CODE&gt;\s&lt;/CODE&gt; and &lt;CODE&gt;\S&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;or try Field Extracter&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 21:11:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-building-regex-for-searches-based-on-cs-username-field/m-p/501620#M139653</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-20T21:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help building regex for searches based on cs_username field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-building-regex-for-searches-based-on-cs-username-field/m-p/501621#M139654</link>
      <description>&lt;P&gt;Hi @Vfinney,&lt;BR /&gt;
try the following regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^\d+-\d+-\d+\s+\d+:\d+:\d+\s+\d+\.\d+\.\d+\.\d+\s+\w+\s\/[^ ]+\s+[^ ]+\s+\d+\s+(?&amp;lt;cs_username&amp;gt;[^ ]+)\s+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or using the rex command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| rex "^\d+-\d+-\d+\s+\d+:\d+:\d+\s+\d+\.\d+\.\d+\.\d+\s+\w+\s\/[^ ]+\s+[^ ]+\s+\d+\s+(?&amp;lt;cs_username&amp;gt;[^ ]+)\s+"
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that you can test at &lt;A href="https://regex101.com/r/xyPcQj/1"&gt;https://regex101.com/r/xyPcQj/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 21:53:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-building-regex-for-searches-based-on-cs-username-field/m-p/501621#M139654</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-05-20T21:53:42Z</dc:date>
    </item>
  </channel>
</rss>

