<?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: After connecting to a windows domain, Splunk displays wrong username in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203042#M187595</link>
    <description>&lt;P&gt;Couldn't get it to work but it made me think about another idea.&lt;/P&gt;

&lt;P&gt;Made some progress:&lt;/P&gt;

&lt;P&gt;sourcetype=%authlog% "session opened" NOT user=root (date_hour &amp;gt;= 19 OR date_hour &amp;lt;= 7) | rex mode=sed "s/DOMAIN+(.*)/\1/"&lt;/P&gt;

&lt;P&gt;It works, but not fully.&lt;/P&gt;

&lt;P&gt;Feb 10 07:29:35 authpriv info devbox.domain.com sshd[16296]:  pam_unix(sshd:session): session opened for user jsmith by (uid=0)&lt;/P&gt;

&lt;P&gt;If i tweak it just a bit.&lt;/P&gt;

&lt;P&gt;sourcetype=%authlog% "session opened" NOT user=root (date_hour &amp;gt;= 19 OR date_hour &amp;lt;= 7) | rex mode=sed "s/DOMAIN+(.*)/\1/" | stats count by user&lt;/P&gt;

&lt;P&gt;I still get DOMAIN and not jsmith.  If I click DOMAIN and drill down into the events it removes the domain.&lt;/P&gt;

&lt;P&gt;And I guess this will be my last post for the day since I can only post twice in a day! That's horrible.&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 08:48:16 GMT</pubDate>
    <dc:creator>crhodes</dc:creator>
    <dc:date>2020-09-29T08:48:16Z</dc:date>
    <item>
      <title>After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203038#M187591</link>
      <description>&lt;P&gt;I've looked around but haven't found the exact same issue I am having.  I need to figure out how to fix the following:&lt;/P&gt;

&lt;P&gt;Feb 10 07:29:35 authpriv info devbox.domain.com sshd[16296]:  pam_unix(sshd:session): session opened for user DOMAIN+jsmith by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/02/10/devbox.domain.com/sshd.log
sourcetype = %authlog%
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Normally it would just be user jsmith but since I joined it to the windows domain it added the domain before the user.  All of the results just show up as DOMAIN.  Is there a way with regex or something else to get it to show up as DOMAIN+jsmith or just jsmith?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 16:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203038#M187591</guid>
      <dc:creator>crhodes</dc:creator>
      <dc:date>2016-02-12T16:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203039#M187592</link>
      <description>&lt;P&gt;Is the field user already extracted?? If yes, update the regex from below sample, or create field extraction if not setup already&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex field=_raw "for user\s+(?&amp;lt;User&amp;gt;\S+)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;BR /&gt;
Looks like there can be spaces between DOMAIN and user name, so try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   your base search | rex field=_raw "for user\s+(?&amp;lt;User&amp;gt;.+)\sby" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2016 17:51:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203039#M187592</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-12T17:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203040#M187593</link>
      <description>&lt;P&gt;I just tried:&lt;/P&gt;

&lt;P&gt;sourcetype=%authlog% "session opened" NOT user=root (date_hour &amp;gt;= 19 OR date_hour &amp;lt;= 7) | rex field=_raw "for user\s+(?\S+)" | stats count by user |sort - count&lt;/P&gt;

&lt;P&gt;and I get just&lt;/P&gt;

&lt;P&gt;DOMAIN&lt;/P&gt;

&lt;P&gt;even if it would say DOMAIN+jsmith or just jsmith but after adding the regex results didn't change.  Did add your bit to it correctly?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203040#M187593</guid>
      <dc:creator>crhodes</dc:creator>
      <dc:date>2020-09-29T08:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203041#M187594</link>
      <description>&lt;P&gt;Try the updated answer&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 19:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203041#M187594</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-12T19:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203042#M187595</link>
      <description>&lt;P&gt;Couldn't get it to work but it made me think about another idea.&lt;/P&gt;

&lt;P&gt;Made some progress:&lt;/P&gt;

&lt;P&gt;sourcetype=%authlog% "session opened" NOT user=root (date_hour &amp;gt;= 19 OR date_hour &amp;lt;= 7) | rex mode=sed "s/DOMAIN+(.*)/\1/"&lt;/P&gt;

&lt;P&gt;It works, but not fully.&lt;/P&gt;

&lt;P&gt;Feb 10 07:29:35 authpriv info devbox.domain.com sshd[16296]:  pam_unix(sshd:session): session opened for user jsmith by (uid=0)&lt;/P&gt;

&lt;P&gt;If i tweak it just a bit.&lt;/P&gt;

&lt;P&gt;sourcetype=%authlog% "session opened" NOT user=root (date_hour &amp;gt;= 19 OR date_hour &amp;lt;= 7) | rex mode=sed "s/DOMAIN+(.*)/\1/" | stats count by user&lt;/P&gt;

&lt;P&gt;I still get DOMAIN and not jsmith.  If I click DOMAIN and drill down into the events it removes the domain.&lt;/P&gt;

&lt;P&gt;And I guess this will be my last post for the day since I can only post twice in a day! That's horrible.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203042#M187595</guid>
      <dc:creator>crhodes</dc:creator>
      <dc:date>2020-09-29T08:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203043#M187596</link>
      <description>&lt;P&gt;I guess we'd need more sample logs to finalize the reg exp here. See if you're able to post another comment.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 21:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203043#M187596</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-12T21:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203044#M187597</link>
      <description>&lt;P&gt;2/10/16&lt;BR /&gt;
7:29:35.000 AM&lt;BR /&gt;&lt;BR /&gt;
Feb 10 07:29:35 authpriv info devbox.domain.com sshd[16296]:  pam_unix(sshd:session): session opened for user jsmith by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/02/10/devbox.domain.com/sshd.log
sourcetype = %authlog%

2/10/16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;7:29:35.000 AM&lt;BR /&gt;&lt;BR /&gt;
Feb 10 07:29:35 authpriv info devbox.domain.com sshd[16294]:  pam_unix(sshd:session): session opened for user jsmith by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/02/10/devbox.domain.com/sshd.log
sourcetype = %authlog%

1/31/16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3:39:54.000 AM&lt;BR /&gt;&lt;BR /&gt;
Jan 31 03:39:54 authpriv info devbox.domain.com sshd[12699]:  pam_unix(sshd:session): session opened for user kwhite by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/01/31/devbox.domain.com/sshd.log
sourcetype = %authlog%

1/31/16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3:39:54.000 AM&lt;BR /&gt;&lt;BR /&gt;
Jan 31 03:39:54 authpriv info devbox.domain.com sshd[12697]:  pam_unix(sshd:session): session opened for user kwhite by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/01/31/devbox.domain.com/sshd.log
sourcetype = %authlog%

1/31/16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3:39:54.000 AM&lt;BR /&gt;&lt;BR /&gt;
Jan 31 03:39:54 authpriv info devbox.domain.com sshd[12693]:  pam_unix(sshd:session): session opened for user kwhite by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/01/31/devbox.domain.com/sshd.log
sourcetype = %authlog%

1/31/16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3:39:54.000 AM&lt;BR /&gt;&lt;BR /&gt;
Jan 31 03:39:54 authpriv info devbox.domain.com sshd[12694]:  pam_unix(sshd:session): session opened for user kwhite by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/01/31/devbox.domain.com/sshd.log
sourcetype = %authlog%

1/31/16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3:39:19.000 AM&lt;BR /&gt;&lt;BR /&gt;
Jan 31 03:39:19 authpriv info devbox.domain.com sshd[10643]:  pam_unix(sshd:session): session opened for user kwhite by (uid=0)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host = splunk.domain.com
punct = __::___.._[]:__(:):_____+__(=)
source = /var/log/archive/incoming/2016/01/31/devbox.domain.com/sshd.log
sourcetype = %authlog%

1/31/16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3:39:17.000 AM&lt;BR /&gt;&lt;BR /&gt;
Jan 31 03:39:17 authpriv info devbox.domain.com sshd[10321]:  pam_unix(sshd:session): session opened for user kwhite by (uid=0)&lt;/P&gt;

&lt;P&gt;but when i add the stats count by user the results are&lt;/P&gt;

&lt;P&gt;DOMAIN  532&lt;/P&gt;

&lt;P&gt;So its like its doing the count BEFORE the regex.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 21:38:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203044#M187597</guid>
      <dc:creator>crhodes</dc:creator>
      <dc:date>2016-02-12T21:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203045#M187598</link>
      <description>&lt;P&gt;It looks like there are some other field extraction setup which is giving the wrong results. Try something like this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=%authlog% "session opened" NOT user=root (date_hour &amp;gt;= 19 OR date_hour &amp;lt;= 7) | table _raw | rex field=_raw "for user\s+(?&amp;lt;user&amp;gt;.+)\sby"   | stats count by user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Feb 2016 02:52:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203045#M187598</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-13T02:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203046#M187599</link>
      <description>&lt;P&gt;That works.  It finally shows the full domain+user.   Do you mind breaking down for me what its doing it?  So I'm assuming the table_raw it taking raw data.  Does it do something different that would cause it not to take raw data?  &lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2016 15:48:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203046#M187599</guid>
      <dc:creator>crhodes</dc:creator>
      <dc:date>2016-02-15T15:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: After connecting to a windows domain, Splunk displays wrong username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203047#M187600</link>
      <description>&lt;P&gt;Apart from regular filter in the base search, the &lt;CODE&gt;"| table _raw "&lt;/CODE&gt; is just keeping raw data and removing all other fields. This way when you do your field extraction for user, only your custom extraction will be applicable.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2016 17:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/After-connecting-to-a-windows-domain-Splunk-displays-wrong/m-p/203047#M187600</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-15T17:29:22Z</dc:date>
    </item>
  </channel>
</rss>

