diff --git a/src/formats/gitea_log.json b/src/formats/gitea_log.json new file mode 100644 index 00000000000..9d1d720b117 --- /dev/null +++ b/src/formats/gitea_log.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://lnav.org/schemas/format-v1.schema.json", + "gitea_log": { + "title": "Gitea", + "description": "The format used by the Gitea code forge. Default format is documented as the value of the `stdflags` flag.", + "url": "https://docs.gitea.com/administration/logging-configuration#flags", + "multiline": true, + "regex": { + "std": { + "pattern": "^(\\^.*m)?(?\\d{4}\/\\d{2}\/\\d{2} \\d{2}:\\d{2}:\\d{2}) (?(\\^.*m)?.*(\\^.*m)?) (\\^.*m)?\\[(?\\w+)](\\^.*m)? (?.*)?$" + } + }, + "value": { + "component": { + "kind": "string", + "identifier": true + } + }, + "level": { + "critical": "^C(RITICAL)?", + "error": "^E(RROR)?", + "warning": "^W(ARNING)?", + "info": "^I(NFO)?", + "debug": "^D(EBUG)?", + "trace": "^T(RACE)?" + }, + "sample": [ + { + "line": "2023/09/24 22:15:55 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 7", + "level": "info" + }, + { + "line": "2023/09/24 22:16:01 routers/common/db.go:21:InitDBEngine() [INFO] Beginning ORM engine initialization.", + "level": "info" + }, + { + "line": "2023/10/08 22:09:10 ...eb/routing/logger.go:68:func1() [I] router: polling GET /user/events for 192.168.1.30:0, elapsed 3800.5ms @ events/events.go:18(events.Events)", + "level": "info" + }, + { + "line": "2023/10/08 16:06:57 ...irror/mirror_pull.go:170:parseRemoteUpdateOutput() [W] parseRemoteUpdateOutput: unexpected update line \" * [new ref] refs/pull/1319/merge -> refs/pull/1319/merge\"", + "level": "warning" + }, + { + "line": "2023/10/08 02:37:48 ...eb/routing/logger.go:68:func1() [WARNING] router: slow POST /user/login for 192.168.56.20:0, elapsed 3362.5ms @ auth/auth.go:170(auth.SignInPost)", + "level": "warning" + }, + { + "line": "^[[36m2023/09/24 22:16:01 ^[[0m^[[32mcmd/web.go:175:^[[32mserveInstalled()^[[0m ^[[1;32m[I]^[[0m PING DATABASE mysql", + "level": "info" + // log line stored with terminal color codes + } + ] + } +} \ No newline at end of file diff --git a/src/formats/i2p_router_log.json b/src/formats/i2p_router_log.json new file mode 100644 index 00000000000..076b9a38eda --- /dev/null +++ b/src/formats/i2p_router_log.json @@ -0,0 +1,56 @@ +{ + "$schema": "https://lnav.org/schemas/format-v1.schema.json", + "i2p_router_log": { + "title": "I2P Router logs", + "description": "The format used by the original I2P Router.", + "url": "https://geti2p.net/", + "multiline": true, + "regex": { + "std": { + "pattern": "^(?J:(?:(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:(?[A-Z]+) \\[(?[\\w \\/]+)\\] (?[\\w.]+): (?.*)|(?:(?:\\^){3} \\d+ similar messages omitted (?:\\^){3})))|(?:(?:(?:[\\w.]+(?Exception):)|(?:\\\tat)) .*)|(?:(?:\\*{3} .*)|(?:Starting I2P.*)|(?:\\[startapp].*)))$" + // The I2P router uses several log line variants that largely differ in their formats. + // Editing a variant should be done below in subformats for better readability and understandability, + // and then merged into the pattern above. + // subformats: + // "variant_normal": "^(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?[A-Z]+) \\[(?[\\w \\\/]+)\\] (?[\\w.]+): (?.*)$" + // "variant_omit": "^(?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}.\\d+) (?:\\^){3} \\d+ similar messages omitted (?:\\^){3}$" + // "variant_exception": "^(?:(?:(?:[\\w.]+(?Exception):)|(?:\\\\0009at)) .*)$" + // "variant_startup_lines": "^(?:(?:\*{3} .*)|(?:Starting I2P.*)|(?:\[startapp].*))$" + } + }, + "value": { + "component": { + "kind": "string", + "identifier": true + } + }, + "level": { + "critical": "^CRIT", + "error": "^(ERROR)|(Exception)", + "warning": "^WARN", + "info": "^INFO", + "debug": "^DEBUG" + }, + "sample": [ + { + "line": "2023-10-25 03:33:41.702 WARN [ handler 1/1] er.transport.udp.PacketHandler: Migrated 91 byte packet from 11.111.111.111:22222 for 11.11.111.111:22222 nTyr4s IB2 recvAge: 60ms sendAge: 3m sendAttemptAge: 60ms sendACKAge: 60ms lifetime: 4m RTT: 60 RTTdev: 16 RTO: 60000 MTU: 1280 LMTU: 1484 cwin: 1500 acwin: 1771 SST: 2560 FRTX? false consecFail: 0 msgs rcvd: 3 msgs sent: 3 pkts rcvd OK/Dup: 7933/0 pkts sent OK/Dup: 3/0 IBM: 0 OBQ: 0 OBL: 0\\n", + "level": "warning" + }, + { + "line": "2023-10-25 03:33:41.764 WARN [ handler 1/1] outer.transport.udp.PeerState2: Dead: 11.111.11.11:22222 F~UzS1 IB2 recvAge: 5s sendAge: 5s sendAttemptAge: 5s sendACKAge: 0ms lifetime: 5s RTT: 50 RTTdev: 19 RTO: 1000 MTU: 1280 LMTU: 1500 cwin: 7315 acwin: 4535 SST: 524288 FRTX? false consecFail: 0 msgs rcvd: 1 msgs sent: 1 pkts rcvd OK/Dup: 2/0 pkts sent OK/Dup: 1/0 IBM: 0 OBQ: 0 OBL: 0\\n", + "level": "warning" + }, + { + "line": "2023-10-25 03:33:42.121 ^^^ 2 similar messages omitted ^^^" + // when lines are repated, the replacmeent line does not have a log level + }, + { + "line": "java.io.IOException: Peer is dead: F~UzS1mTN3XYlnOfidMBv5Z4lHI7dsCZ8N5mxpyc-OU=\\n" + // handle exception lines + }, + { + "line": "\\u0009at net.i2p.router.transport.udp.PeerState2.getNextPacketNumber(PeerState2.java:326)\\n" + } + ] + } +} \ No newline at end of file diff --git a/src/formats/logcat.json b/src/formats/logcat.json new file mode 100644 index 00000000000..3532d4ba6fb --- /dev/null +++ b/src/formats/logcat.json @@ -0,0 +1,60 @@ +{ + "$schema": "https://lnav.org/schemas/format-v1.schema.json", + "logcat_log" : { + "title" : "logcat", + "description" : "The system logger format of the Android operating system.", + "url" : "https://developer.android.com/studio/command-line/logcat.html", + "regex" : { + "logcat_format_threadtime" : { // threadtime is a format accepted by the `logcat -v ` command + "pattern" : "^(?\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}:\\d{2}.\\d{3})\\s+(?\\d+)\\s+(?\\d+)\\s+(?\\w)\\s+(?:\\[@@\\s+\\]\\s)?(?.*)(?:\\s+)?:\\s+(?.*)$" + } + }, + "timestamp-format" : ["%m-%d %H:%M:%S.%L"], + "level-field" : "level", + "level" : { + "trace" : "^V", + "debug" : "^D", + "info": "^I", + "warning" : "^W", + "error" : "^E", + "fatal": "^F" + }, + "opid-field" : "log_pid", + "value" : { + "log_pid" : { + "kind" : "string", + "identifier" : true + }, + "log_tid" : { + "kind" : "string", + "identifier" : true + }, + "log_tag" : { + "kind" : "string", + "identifier" : true + } + }, + "sample" : [ + { + "line": "01-01 02:50:25.351 1310 1502 V WindowManager: handleMessage: exit", + "level": "trace" + }, + { + "line": "01-14 17:00:04.817 701 2042 I android.hardware.usb@1.0-service: canChangeMode: 1 canChagedata: 1 canChangePower:1", + "level": "info" + }, + { + "line": "01-14 17:00:03.978 24312 24778 D OffsetFinder: findOffsetCustom: found value 268959769 at 4 (with arg: 25)", + "level": "debug" + }, + { + "line": "01-14 17:00:04.052 4453 4453 V com.jarsilio.android.waveup (ProximitySensorHandler): Proximity sensor changed: FAR (current sensor value: 5.0 - max. sensor value: 5.0)", + "level": "trace" + }, + { + "line": "01-14 17:00:04.835 516 516 W Binder:516_1: type=1400 audit(0.0:1361): avc: denied { read } for name=\"wakeup8\" dev=\"sysfs\" ino=46048 scontext=u:r:system_suspend:s0 tcontext=u:object_r:sysfs:s0 tclass=dir permissive=0", + "level": "warning" + } + ] + } +} diff --git a/src/formats/syncthing.json b/src/formats/syncthing.json new file mode 100644 index 00000000000..304bb61d4dc --- /dev/null +++ b/src/formats/syncthing.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://lnav.org/schemas/format-v1.schema.json", + "syncthing_log" : { + "title" : "Syncthing", + "description" : "The Syncthing P2P file synchronization program's log format", + "url" : "https://syncthing.net/", + "regex" : { + "std" : { + "pattern" : "^\\[[A-Za-z0-9]{5}\\] (?\\d{4}/\\d{2}/\\d{2} \\d{2}:\\d{2}:\\d{2}(.\\d+)?) ?([a-zA-Z0-9.]+:\\d+:)? (?\\w+): (?.*)$" + } + }, + "level-field" : "level", + "sample" : [ + { + "line": "[AAAAA] 2024/07/04 13:11:39 INFO: Exiting", + "level": "info" + }, + { + "line": "[start] 2024/07/04 13:10:53 INFO: syncthing v1.27.9", + "level": "info" + }, + { + "line": "[AAAAA] 2024/07/02 13:37:27 WARNING: Automatically upgraded to version \"v1.27.9\". Restarting in 1 minute.", + "level": "warning" + }, + { + "line": "[AAAAA] 2023/11/06 19:00:47.078070 local.go:203: DEBUG: discover: Received local announcement", + "level": "debug" + } + ] + } +} \ No newline at end of file