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
Michael
The program doesn't support custom fields at the moment, but you can replace one of the fields you don't need (e.g. server - s-computername field in IIS, or username - cs-username field in IIS). In such case you can create a custom table on these value in Options > Report > Tables, and then use the modification rules with regular expressions to extract data you need.

You can find information on creating custom tables at https://www.weblogexpert.com/help/wle...
Avatar
James Kmetz
Thanks Michael, but i still dont understand how i can add MediaBrowser Client="Emby Mobile", Device="Chrome 54.0.2840.100", DeviceId="d964b3273b46b32a8d92730e85696094120a787a", Version="3.1.234.0", UserId="1de587e5988caadbe6f60a4f50d792e0" in the server field and report on individual items within that server field, like just the "Client" or "Device" values, can you give me an example please?

Also is there a section in your manual that tells what each of your variables mean? Like: %h %l %u %t etc..... for example %u = User %I = ? and so on....
Avatar
Michael
What server do you use?

If you use Apache (or another server that produce similar logs), you need to set a log that includes this field. When you specify the log format in Profile Properties > Log Files, you need to specify the server field identifier (%A) instead of the real format for this field. So the server will place the value of this field to the server field.

You can find the list of field for Apache logs at http://httpd.apache.org/docs/current/...

After you verified that the values of the field are shown in the Access Statistics > Servers report, you need to create a custom report on it. You can do it by creating a table in Options > Analysis > Tables. You need to create a table, choose "Server" as the main data on the Data tab, click the Custom button and specify the data modification rules using regular expressions. You can find the description of the mofication rules at https://www.weblogexpert.com/help/wle...

If you send to us at support@weblogexpert.com a sample log file from your site including the field, I'll be able to provide more information on exact settings you need to use in your case.
Avatar
James Kmetz
I'm using nginx, and i have the string added, and weblog sees it, but I dont know how to grab specific items from the server string..... This is what weblog sees:

I want to report on "Mediabrowser Client" and "Device" i need those strings without the "\x22" to be reported on. the \x22 should show up as " not sure why it is not.
Avatar
Michael
You need to add modification rules for the table data like the following:

Mediabrowser Client.\\x22(.*?)\\x22 = \1

You can also create a similar table for devices with the following modification rules:

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

You can find more information on the modification rules at https://www.weblogexpert.com/help/wle...