cancel
Showing results for 
Search instead for 
Did you mean: 
marduk
Level 9

Adding referrer to access.log

Jump to solution

Hi,

I am looking to add the referrer field to the access logs. To get the referrer data I suspect I need to do some sort of Header.Request property manipulation.

Am I on the correct track ?

Any pointers appreciated.

Thanks

Marduk

0 Kudos
1 Solution

Accepted Solutions
marduk
Level 9

Re: Adding referrer to access.log

Jump to solution

Hi,

This worked for me

+ Header.Request.Get ("Referer")

Thanks

0 Kudos
3 Replies
pbrickey
Level 11

Re: Adding referrer to access.log

Jump to solution

Hi Marduk,

You are correct. The 'referrer' is a header so you need to use Header.Request.Get. Take a look at the default access.log and you can see how user-agent is retrieved and follow that convention. Don't forget to update your header line if pushing to Web Reporter.

-Patrick

0 Kudos
btlyric
Level 12

Re: Adding referrer to access.log

Jump to solution

You want the value from Header.Request.Get ("Referer")

You can add it to the log line via:

String.ReplaceAll (String.ReplaceIfEquals (Header.Request.Get ("Referer"), "", "-"), "=", "\=")

NOTE: the reason for this specific formatting is that the logs are going into a SIEM which has a standard that states that = signs should be escaped with a \ character.

0 Kudos
marduk
Level 9

Re: Adding referrer to access.log

Jump to solution

Hi,

This worked for me

+ Header.Request.Get ("Referer")

Thanks

0 Kudos