<?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 to extract the username from a raw event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479508#M134388</link>
    <description>&lt;P&gt;Yes this did the task. But i still have many other fields to be extracted with regular expression and add them to table finally.&lt;/P&gt;

&lt;P&gt;In my next reply, can i paste another sample log file? with which we can fine tune this query more?&lt;/P&gt;

&lt;P&gt;Thanks lot in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2020 16:48:45 GMT</pubDate>
    <dc:creator>vasuparvatham</dc:creator>
    <dc:date>2020-04-23T16:48:45Z</dc:date>
    <item>
      <title>How to extract the username from a raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479503#M134383</link>
      <description>&lt;P&gt;Here is the raw event log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Apr 22 08:04:46 10.14.10.66 1 2020-04-22T08:04:47-07:00 connect.abcd.com PulseSecure: - - - 2020-04-22 08:04:47 - ive - [10.12.6.240] sramachandran(VPNUsers)[] - Login failed. Reason: No Roles
Apr 22 08:04:46 10.14.10.66 1 2020-04-22T08:04:47-07:00 connect.abcd.com PulseSecure: - - - 2020-04-22 08:04:47 - ive - [10.12.6.240] sramachandran(VPNUsers)[] - Login failed from 10.12.6.240 for sramachandran/VPNUsers. All roles restricted.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to extract only the username (ex: sramachandran in this case) to a field called  &lt;CODE&gt;"UserName"&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Can you please help me achieve this?&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 16:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479503#M134383</guid>
      <dc:creator>vasuparvatham</dc:creator>
      <dc:date>2020-04-22T16:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the username from a raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479504#M134384</link>
      <description>&lt;P&gt;Use rex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?&amp;lt;UserName&amp;gt;\w+)\(VPNUsers\)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Smaple query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="Apr 22 08:04:46 10.14.10.66 1 2020-04-22T08:04:47-07:00 connect.abcd.com PulseSecure: - - - 2020-04-22 08:04:47 - ive - [10.12.6.240] sramachandran(VPNUsers)[] - Login failed from 10.12.6.240 for sramachandran/VPNUsers. All roles restricted." | rex "(?&amp;lt;UserName&amp;gt;\w+)\(VPNUsers\)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Apr 2020 17:12:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479504#M134384</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-04-22T17:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the username from a raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479505#M134385</link>
      <description>&lt;P&gt;Assuming the username always follows the IP address, which is in square brackets, this should do it.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;]\s+(?&amp;lt;UserName&amp;gt;\w+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 17:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479505#M134385</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-22T17:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the username from a raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479506#M134386</link>
      <description>&lt;P&gt;index="juniperindex" ("Login Failed*" OR "Primary authentication failed") is my initial query to find the results:&lt;/P&gt;

&lt;P&gt;The outcome events look like:&lt;/P&gt;

&lt;P&gt;Apr 22 21:21:21 10.14.10.66 1 2020-04-22T21:21:21-07:00 connect.abcd.com PulseSecure: - - - 2020-04-22 21:21:21 - ive - [12.12.2.28] vinduri(VPNUsers)[] - Login failed using auth server LasVegas DC (LDAP Server).  Reason: Failed&lt;/P&gt;

&lt;P&gt;Apr 22 21:21:21 10.14.10.66 1 2020-04-22T21:21:21-07:00 connect.abcd.com PulseSecure: - - - 2020-04-22 21:21:21 - ive - [14.13.8.28] rgunasek(VPNUsers)[] - Primary authentication failed for vinduri/LasVegas DC from x.y.z.a&lt;/P&gt;

&lt;P&gt;Can you now help me?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 04:24:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479506#M134386</guid>
      <dc:creator>vasuparvatham</dc:creator>
      <dc:date>2020-04-23T04:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the username from a raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479507#M134387</link>
      <description>&lt;P&gt;Below query should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="juniperindex" ("Login Failed*" OR "Primary authentication failed") | rex "(?&amp;lt;UserName&amp;gt;\w+)\(VPNUsers\)" | table UserName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Apr 2020 07:00:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479507#M134387</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-04-23T07:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract the username from a raw event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479508#M134388</link>
      <description>&lt;P&gt;Yes this did the task. But i still have many other fields to be extracted with regular expression and add them to table finally.&lt;/P&gt;

&lt;P&gt;In my next reply, can i paste another sample log file? with which we can fine tune this query more?&lt;/P&gt;

&lt;P&gt;Thanks lot in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 16:48:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-the-username-from-a-raw-event/m-p/479508#M134388</guid>
      <dc:creator>vasuparvatham</dc:creator>
      <dc:date>2020-04-23T16:48:45Z</dc:date>
    </item>
  </channel>
</rss>

