carina-studio / ULogViewer

Cross-Platform Universal Log Viewer.
https://carina-studio.github.io/ULogViewer/
MIT License
380 stars 39 forks source link

Custom Log Properties to Show #41

Open derekcarlos opened 4 months ago

derekcarlos commented 4 months ago

I am trying to create a Log Profile for Access Logs, and I tried it with the following Regular Expression:

^(?<Client_IP>\S+)\s+(?<Server_IP>\S+)\s+(?<field3>\S+)\s+(?<date>\d{4}-\d{2}-\d{2})\s+(?<time>\d{2}:\d{2}:\d{2})\s+(?<method>\S+)\s+(?<url>\S+)\s+(?<query_string>\S+)\s+(?<status_code>\d+)\s+(?<bytes_sent>\d+)\s+(?<response_time>\d+\.\d+)$

It tests successfully when I try it with a sample log line, but when I try to add a Log Property, the name I set up above doesn't appear on the Property Dropdown unless I use one of the predefined names when setting up the Regular Expression. Would it be possible for me to use my own Log Property Names?

I am using the latest version for macOS (v. 4.0.9.331)

hamster620 commented 4 months ago

@derekcarlos For better performance and memory usage, only predefined log properties are supported. Currently Extra1 to Extra20 are defined for custom log properties, you can use them with inline comment:

^(?<Extra1>(?#ClientIP)\S+)\s+(?<Extra2>(?#ServerIP)\S+)...