<?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: Anyway to see X-Forwarded-For in Splunk access logs? in Security</title>
    <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165227#M4906</link>
    <description>&lt;P&gt;Ahh, thank you! This is very helpful. I was using the following search which is only showing the LB IP address:&lt;BR /&gt;
&lt;CODE&gt;index=_audit action="login attempt" info=failed&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;When I look at the web_access logs I do indeed see the correct information now:&lt;BR /&gt;
&lt;CODE&gt;index=_internal source="*web_access.log"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I'll see if I can poke around today and figure out if there is any way to modify the login attempt entries to check for an XFF header first and if I find anything I'll share with the community.&lt;/P&gt;

&lt;P&gt;Thanks for the help, andrewcg!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:06:48 GMT</pubDate>
    <dc:creator>john_thom</dc:creator>
    <dc:date>2020-09-29T18:06:48Z</dc:date>
    <item>
      <title>Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165215#M4894</link>
      <description>&lt;P&gt;I'm looking to implement some brute force login attempt detection/mitigation for a Splunk cluster. Splunkweb in this case is running behind a loadbalancer so I can't use the source IP from the access logs. I need to rely on the X-Forwarded-For header in the HTTP request but that's not being logged.&lt;/P&gt;

&lt;P&gt;Does anyone know how to make splunkweb log the X-Forwarded-For in its access logs?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 17:32:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165215#M4894</guid>
      <dc:creator>jimcroft</dc:creator>
      <dc:date>2014-02-25T17:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165216#M4895</link>
      <description>&lt;P&gt;Yeah... just not a very nice one.&lt;/P&gt;

&lt;P&gt;In &lt;CODE&gt;$SPLUNK_HOME/Python-2.7/Lib/site-packages/splunk/appserver/mrsparkle/lib/customlogmanager.py&lt;/CODE&gt;'s &lt;CODE&gt;access()&lt;/CODE&gt; method you can fiddle with the log format as you please.&lt;BR /&gt;
To verify this I've quickly appended line 63 to get this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;self.access_log.log(logging.INFO, (self.access_log_format % atoms) + (' - %s %dms' % (get_request_id(), round((time.time() - response.time)*1000))) + ' X-Requested-With=' + inheaders.get('X-Requested-With'))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The X-Requested-With header gets added to the end of the line nicely, so I expect the same when you have the X-Forwarded-For header present.&lt;/P&gt;

&lt;P&gt;Note, changes made down there likely won't be supported and certainly won't survive a Splunk update. Any modifications require a restart of Splunkweb.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2014 20:16:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165216#M4895</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-02-25T20:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165217#M4896</link>
      <description>&lt;P&gt;Yeah, that's not pretty but thanks for the pointer!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 09:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165217#M4896</guid>
      <dc:creator>jimcroft</dc:creator>
      <dc:date>2014-02-26T09:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165218#M4897</link>
      <description>&lt;P&gt;This seems like a critical feature for Search Head clusters.  If you have a load balancer or if you offload your SSL you really need the XForward header in order to know where users are coming from.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 15:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165218#M4897</guid>
      <dc:creator>andrewcg</dc:creator>
      <dc:date>2015-08-25T15:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165219#M4898</link>
      <description>&lt;P&gt;Wouldn't it be better to change line 38 from:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    atoms = {'h': remote.name or remote.ip,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    atoms = {'h': inheaders.get('X-Forwarded-For', '') or remote.name or remote.ip,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will put the X-Forwarded-For header in the h atom if it exists.  That way any Splunk App, dashboard or search that is looking at these logs would not need to be updated to look of the client IP at the end of the log line.&lt;/P&gt;

&lt;P&gt;Also the location of the file to edit is here, at least in Splunk 6.3 for 64 bit Linux:&lt;/P&gt;

&lt;P&gt;$SPLUNK_HOME/lib/python2.7/site-packages/splunk/appserver/mrsparkle/lib/customlogmanager.py&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 20:16:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165219#M4898</guid>
      <dc:creator>andrewcg</dc:creator>
      <dc:date>2015-10-02T20:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165220#M4899</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;has somebody made this work with 6.5 or 6.6 ?&lt;BR /&gt;
I don't see any effect after modifying this file so I'm not sure it's still used by these versions in default webserver configuration ...&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 14:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165220#M4899</guid>
      <dc:creator>maraman_splunk</dc:creator>
      <dc:date>2017-07-20T14:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165221#M4900</link>
      <description>&lt;P&gt;I tried two or three different files that mentioned access_log/atoms and I was unable to get this working...&lt;/P&gt;

&lt;P&gt;In fact I couldn't even get the log to update to write the new log statement I had added so I'm unsure which file controls the access log in the newer 6.5.x versions.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 22:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165221#M4900</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2017-07-20T22:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165222#M4901</link>
      <description>&lt;P&gt;For any visitors finding this in 2018: The solution from &lt;A href="https://answers.splunk.com/comments/315243/view.html"&gt;andrewcg's comment&lt;/A&gt; above is still working for me in 7.0.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 02:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165222#M4901</guid>
      <dc:creator>mtulett_splunk</dc:creator>
      <dc:date>2018-01-17T02:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165223#M4902</link>
      <description>&lt;P&gt;Thanks for the confirmation, I might try again in Splunk 7...&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 02:42:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165223#M4902</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-01-17T02:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165224#M4903</link>
      <description>&lt;P&gt;Just for reference, I've successfully tested the andrewcg solution in 6.6.5.&lt;BR /&gt;
P.S. Watch out for the correct identation or it won't work.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 13:52:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165224#M4903</guid>
      <dc:creator>m1k34Splunk</dc:creator>
      <dc:date>2018-02-07T13:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165225#M4904</link>
      <description>&lt;P&gt;Hey andrewcg or m1k34Splunk,&lt;BR /&gt;
Did you make this change on the search heads themselves? I did it on my search heads and it doesn't appear to be working. I tried including it in atoms['h'] and the access_log write itself (I even tried injecting it into both spots once). Restarted splunkweb after each change but neither seems to have any effect. Still shows the VIP from my load balancer. I'm also on 6.6.x. I feel like I must be missing something silly here.&lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 22:25:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165225#M4904</guid>
      <dc:creator>john_thom</dc:creator>
      <dc:date>2018-02-12T22:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165226#M4905</link>
      <description>&lt;P&gt;So it looks like the problem with this hack is that it only fixes the logging in:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;web_access.log&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;The other logs are all unchanged:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;splunkd_ui_access.log&lt;/LI&gt;
&lt;LI&gt;splunkd_access.log&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;splunkd_ui_access.log&lt;/STRONG&gt; - shows the proxy&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var/log/splunk/splunkd_ui_access.log:127.0.0.1 - admin [13/Feb/2018:11:00:47.110 -0500] "GET /en-US/ HTTP/1.1" 303 105 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0" - c0027a96a8de667c7653660d00411b6e 18ms
var/log/splunk/splunkd_ui_access.log:127.0.0.1 - admin [13/Feb/2018:11:00:47.183 -0500] "GET /en-US/app/launcher HTTP/1.1" 303 110 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0" - c0027a96a8de667c7653660d00411b6e 181ms
var/log/splunk/splunkd_ui_access.log:127.0.0.1 - admin [13/Feb/2018:11:00:47.516 -0500] "GET /en-US/app/launcher/home HTTP/1.1" 200 1264 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0" - c0027a96a8de667c7653660d00411b6e 161ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;web_access.log&lt;/STRONG&gt;    - shows the X-Forwarded-For&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var/log/splunk/web_access.log:10.32.136.60 - admin [13/Feb/2018:11:00:47.111 -0500] "GET /en-US/ HTTP/1.1" 303 105 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0" - 5a830baf1c7ff401228990 17ms
var/log/splunk/web_access.log:10.32.136.60 - admin [13/Feb/2018:11:00:47.183 -0500] "GET /en-US/app/launcher HTTP/1.1" 303 110 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0" - 5a830baf2f7ff401228a10 180ms
var/log/splunk/web_access.log:10.32.136.60 - admin [13/Feb/2018:11:00:47.517 -0500] "GET /en-US/app/launcher/home HTTP/1.1" 200 1264 "" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0" - 5a830baf847ff4012285d0 159ms
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:06:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165226#M4905</guid>
      <dc:creator>andrewcg</dc:creator>
      <dc:date>2020-09-29T18:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165227#M4906</link>
      <description>&lt;P&gt;Ahh, thank you! This is very helpful. I was using the following search which is only showing the LB IP address:&lt;BR /&gt;
&lt;CODE&gt;index=_audit action="login attempt" info=failed&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;When I look at the web_access logs I do indeed see the correct information now:&lt;BR /&gt;
&lt;CODE&gt;index=_internal source="*web_access.log"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I'll see if I can poke around today and figure out if there is any way to modify the login attempt entries to check for an XFF header first and if I find anything I'll share with the community.&lt;/P&gt;

&lt;P&gt;Thanks for the help, andrewcg!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165227#M4906</guid>
      <dc:creator>john_thom</dc:creator>
      <dc:date>2020-09-29T18:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165228#M4907</link>
      <description>&lt;P&gt;The log of login attempt action comes from $SPLUNK_HOME/bin/splunkd, there is no other way to modify it for showing the XFF msg.&lt;/P&gt;

&lt;P&gt;The web_access.log only log the requests which after login, not the fail login attempt. &lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 02:26:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/165228#M4907</guid>
      <dc:creator>hello007</dc:creator>
      <dc:date>2019-04-25T02:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Anyway to see X-Forwarded-For in Splunk access logs?</title>
      <link>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/561484#M15438</link>
      <description>&lt;P&gt;Still works in 2021, except look in python3.x folder instead of 2&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 04:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Anyway-to-see-X-Forwarded-For-in-Splunk-access-logs/m-p/561484#M15438</guid>
      <dc:creator>ttsarenko_splun</dc:creator>
      <dc:date>2021-07-30T04:39:34Z</dc:date>
    </item>
  </channel>
</rss>

