<?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: IP address of current user? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310954#M93236</link>
    <description>&lt;P&gt;Depending on your infrastructure, the following &lt;EM&gt;may&lt;/EM&gt; work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access 
    [| rest /services/authentication/current-context splunk_server=local 
    | stats values(username) AS search 
    | format ] 
| head 1 
| stats list(clientip) AS clientip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch will return the username of the user who is currently logged in. It uses that to search across &lt;CODE&gt;splunkd_ui_access&lt;/CODE&gt; logs and extracts the &lt;CODE&gt;clientip&lt;/CODE&gt; from the latest matching one.&lt;/P&gt;

&lt;P&gt;However, this doesn't work at all on my system, because we have a proxy on our Splunk server, which means this returns 127.0.0.1 for every user. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So your mileage may vary.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2018 22:37:43 GMT</pubDate>
    <dc:creator>elliotproebstel</dc:creator>
    <dc:date>2018-02-23T22:37:43Z</dc:date>
    <item>
      <title>IP address of current user?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310951#M93233</link>
      <description>&lt;P&gt;I'm trying to write a query to display the IP address of the current user. Anyone know how to do this?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 21:10:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310951#M93233</guid>
      <dc:creator>matstap</dc:creator>
      <dc:date>2018-02-23T21:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: IP address of current user?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310952#M93234</link>
      <description>&lt;P&gt;Current user using Splunk Web UI (trying to display from user logged in from)?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 21:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310952#M93234</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-23T21:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: IP address of current user?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310953#M93235</link>
      <description>&lt;P&gt;We're going to need more information than that..&lt;/P&gt;

&lt;P&gt;Are your events logging in Splunk? Did you have a field that captures the IP addresses? Do you have a field or lookup table of users? You want the current users IP address who's logged into Splunk? And lastly, ofcourse we know how to do this.. You provide the correct information and we provide the correct solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 21:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310953#M93235</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-02-23T21:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: IP address of current user?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310954#M93236</link>
      <description>&lt;P&gt;Depending on your infrastructure, the following &lt;EM&gt;may&lt;/EM&gt; work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_ui_access 
    [| rest /services/authentication/current-context splunk_server=local 
    | stats values(username) AS search 
    | format ] 
| head 1 
| stats list(clientip) AS clientip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch will return the username of the user who is currently logged in. It uses that to search across &lt;CODE&gt;splunkd_ui_access&lt;/CODE&gt; logs and extracts the &lt;CODE&gt;clientip&lt;/CODE&gt; from the latest matching one.&lt;/P&gt;

&lt;P&gt;However, this doesn't work at all on my system, because we have a proxy on our Splunk server, which means this returns 127.0.0.1 for every user. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So your mileage may vary.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 22:37:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/IP-address-of-current-user/m-p/310954#M93236</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-23T22:37:43Z</dc:date>
    </item>
  </channel>
</rss>

