I need help reporting on a custom header please?

Avatar
  • Answered
Here is my custom header value:

x-emby-authorization:MediaBrowser Client="Emby Mobile", Device="Chrome 54.0.2840.100", DeviceId="d964b3273b46b32a8d92730e85696094120a787a", Version="3.1.234.0", UserId="1de587e5988caadbe6f60a4f50d792e0"

That is one header with multiple values within it, I would like to report on "MediaBrowser Client" and "Device" in that string..

I know how to add this to my log file, but dont know how to have WLE grab this info and use it.. Any examples you can lend me please?
Avatar
James Kmetz
I really need to learn regex... Thanks Michael for the help, I'll give it a go!
Avatar
James Kmetz
Hum... tried:

Device.\\x22(.*?)\\x22 = \1
and Device.\"(.*?)\" = \1

Neither returned results for some reason..... I see all "Unnamed Servers" in the results.

when I check "Keep original value if no rules match it" i get the full string in the report like my above screenshot. So its not matching those regex strings even though it should be... And does when i use an online regex tester.
Avatar
James Kmetz
is this a bug?
Avatar
Michael
Could you please send me to support@weblogexpert.com few lines from your log with this value so I can check them?
Avatar
James Kmetz
Sent...
Avatar
Michael
Actually the regex was correct, what was incorrect is that for the regex modification rules = should be replaced with ~= , for example:

Device.\\x22(.*?)\\x22 ~= \1
Avatar
James Kmetz
Ahhh.. That was it... It works....

Now how can I hide the "Unnamed Servers" results from the report totally?

Avatar
Michael
You cannot do it with the Server field. You can set the log format to map the field to the username field (%u in Apache logs) and then set the data to "User name" in the custom table.
Avatar
James Kmetz
What other fields are there in weblog that i could use? I have not seen a complete list of fields and identifiers? I am using the username (i think) authenticated user is what i'm using. I guess i can deal with the unnamed Servers if i have to.
Avatar
Michael
You can try to use the virtual domain (%v) field. Other fields are usually either too important to be used for other purposes, or have a special meaning.

You can view the list of fields that can be used in the program at https://www.weblogexpert.com/help/wle... , you should check that list of fields in IIS logs. The appropriate identifiers for Apache logs can be found at http://httpd.apache.org/docs/current/...