I am trying to log the cookie info using
CustomLog $PATH "%{cookie}i"
Now i want the certain variables ex(hb_name, hb_email, hb_cellno, hb_visit, hb_session
) to be logged into my log file from this cookie.
How can I parse out specific values from this cookie and log them?
Best Answer
Well, that completely depends on the format of the cookie - but a little regex should get you there.
Say your cookie's content were
hb_name:A,hb_email:a@example.com,hb_cellno:1112223333
:So that puts each of these values into their own Apache environment variable, which can then be logged easily:
If you can clarify the exact format of your cookie and the exact format you want the log in, then I can be more specific.