<?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: Need help to identify user field in my current search string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-identify-user-field-in-my-current-search-string/m-p/340307#M100928</link>
    <description>&lt;P&gt;That's looking like unix log records.  Your best bet is to take all the events from about 30 seconds before to ten seconds after and look at each one.  &lt;/P&gt;

&lt;P&gt;Here's a set of log records I stole for reference off of &lt;A href="https://unix.stackexchange.com/questions/250196/how-to-track-who-added-sudo-privilege-to-a-user"&gt;stackexchange&lt;/A&gt;  ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ cat /var/log/auth.log | grep -i xyz
Dec 18 18:54:51 pandya-desktop sudo:   pandya : TTY=pts/2 ; PWD=/home/pandya ; USER=root ; COMMAND=/usr/sbin/useradd xyz
Dec 18 18:54:51 pandya-desktop useradd[7763]: new group: name=xyz, GID=1002
Dec 18 18:54:51 pandya-desktop useradd[7763]: new user: name=xyz, UID=1002, GID=1002, home=/home/xyz, shell=
Dec 18 18:55:51 pandya-desktop sudo:   pandya : TTY=pts/2 ; PWD=/home/pandya ; USER=root ; COMMAND=/usr/sbin/usermod -a -G group xyz
Dec 18 18:55:57 pandya-desktop sudo:   pandya : TTY=pts/2 ; PWD=/home/pandya ; USER=root ; COMMAND=/usr/sbin/usermod -a -G sudo xyz
Dec 18 18:55:57 pandya-desktop usermod[7872]: add 'xyz' to group 'sudo'
Dec 18 18:55:57 pandya-desktop usermod[7872]: add 'xyz' to shadow group 'sudo'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your search is keying off the last record.  &lt;/P&gt;

&lt;P&gt;The immediately prior set of records indicate that the user involved in altering user xyz was &lt;CODE&gt;USER=root&lt;/CODE&gt;.  (Really helpful, right?)&lt;/P&gt;

&lt;P&gt;The one other thing I noticed, poking around a bit, is that sometimes there will be a logoff right after the person does this.  You might see something like "connection closed by 1.2.3.4" .  So, that could be a clue too.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 19:32:14 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-08-01T19:32:14Z</dc:date>
    <item>
      <title>Need help to identify user field in my current search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-identify-user-field-in-my-current-search-string/m-p/340305#M100926</link>
      <description>&lt;P&gt;Below is my search string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* host=* sourcetype="*" "usermod" "add" "to shadow group" | rex "^(?:[^'\n]*'){3}(?P&amp;lt;addedToGroup&amp;gt;\w+)" | rex "^[^'\n]*'(?P&amp;lt;userInGroup&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search shows me which user was added to which group but I really need it to show WHO added the user to the group. I can't figure out how to find the actual user who ran the usermod command. What do I need to do to get that field?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 17:27:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-to-identify-user-field-in-my-current-search-string/m-p/340305#M100926</guid>
      <dc:creator>jcorkey</dc:creator>
      <dc:date>2017-08-01T17:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to identify user field in my current search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-identify-user-field-in-my-current-search-string/m-p/340306#M100927</link>
      <description>&lt;P&gt;Can you share a sample event? Do you know if the raw data contains who ran the command?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 18:10:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-to-identify-user-field-in-my-current-search-string/m-p/340306#M100927</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-01T18:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to identify user field in my current search string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-to-identify-user-field-in-my-current-search-string/m-p/340307#M100928</link>
      <description>&lt;P&gt;That's looking like unix log records.  Your best bet is to take all the events from about 30 seconds before to ten seconds after and look at each one.  &lt;/P&gt;

&lt;P&gt;Here's a set of log records I stole for reference off of &lt;A href="https://unix.stackexchange.com/questions/250196/how-to-track-who-added-sudo-privilege-to-a-user"&gt;stackexchange&lt;/A&gt;  ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ cat /var/log/auth.log | grep -i xyz
Dec 18 18:54:51 pandya-desktop sudo:   pandya : TTY=pts/2 ; PWD=/home/pandya ; USER=root ; COMMAND=/usr/sbin/useradd xyz
Dec 18 18:54:51 pandya-desktop useradd[7763]: new group: name=xyz, GID=1002
Dec 18 18:54:51 pandya-desktop useradd[7763]: new user: name=xyz, UID=1002, GID=1002, home=/home/xyz, shell=
Dec 18 18:55:51 pandya-desktop sudo:   pandya : TTY=pts/2 ; PWD=/home/pandya ; USER=root ; COMMAND=/usr/sbin/usermod -a -G group xyz
Dec 18 18:55:57 pandya-desktop sudo:   pandya : TTY=pts/2 ; PWD=/home/pandya ; USER=root ; COMMAND=/usr/sbin/usermod -a -G sudo xyz
Dec 18 18:55:57 pandya-desktop usermod[7872]: add 'xyz' to group 'sudo'
Dec 18 18:55:57 pandya-desktop usermod[7872]: add 'xyz' to shadow group 'sudo'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Your search is keying off the last record.  &lt;/P&gt;

&lt;P&gt;The immediately prior set of records indicate that the user involved in altering user xyz was &lt;CODE&gt;USER=root&lt;/CODE&gt;.  (Really helpful, right?)&lt;/P&gt;

&lt;P&gt;The one other thing I noticed, poking around a bit, is that sometimes there will be a logoff right after the person does this.  You might see something like "connection closed by 1.2.3.4" .  So, that could be a clue too.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 19:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-to-identify-user-field-in-my-current-search-string/m-p/340307#M100928</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-01T19:32:14Z</dc:date>
    </item>
  </channel>
</rss>

