Skip to content

Instantly share code, notes, and snippets.

@cgrinham
Last active August 14, 2025 12:48
Show Gist options
  • Save cgrinham/0d3e7a89ed6fa6cd355bc62f76461da3 to your computer and use it in GitHub Desktop.
Save cgrinham/0d3e7a89ed6fa6cd355bc62f76461da3 to your computer and use it in GitHub Desktop.
lnav format file for asterisk
{
"$schema": "https://lnav.org/schemas/format-v1.schema.json",
"asterisk": {
"title": "Asterisk full log",
"description": "Parses Asterisk 'full' logs with fractional seconds, optional call-id, thread id, module, and body.",
"file-type": "text",
"file-pattern": ".*/asterisk/full.*",
"ordered-by-time": true,
"timestamp-format": ["%Y-%m-%d %H:%M:%S.%f"],
"timestamp-field": "ts",
"level-field": "level",
"module-field": "module",
"body-field": "body",
"regex": {
"asterisk-full": {
"pattern": "^\\[(?<ts>\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{4})\\] (?<level>[A-Z]+)\\[(?<thread_id>\\d+)(?:\\]\\[(?<call_id>C-[0-9a-f]+))?\\] (?<module>[^:]+): (?<body>.*)$"
}
},
"value": {
"thread_id": { "kind": "integer" }
},
"level": {
"debug": "^(VERBOSE|DEBUG)$",
"info": "^(NOTICE|INFO)$",
"warning": "^WARNING$",
"error": "^ERROR$",
"critical": "^CRITICAL$"
},
"sample": [
{ "line": "[2025-08-13 15:03:56.0157] VERBOSE[412562][C-000530ed] app_dial.c: Local/2TM87hXu@wazo_wait_for_registration-0003eaed;1 is ringing" },
{ "line": "[2025-08-13 15:03:57.0537] VERBOSE[412281][C-000530e0] bridge_channel.c: Channel PJSIP/T6gY0R6n-000b7e7e left 'simple_bridge' basic-bridge <99bdf7d7-46ec-4b2c-88ac-54f800ee6e23>" },
{ "line": "[2025-08-13 15:03:58.3993] NOTICE[123653] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '<sip:[email protected]>' failed for '81.107.221.26:5060' (callid: [email protected]) - Failed to authenticate" },
{ "line": "[2025-08-13 15:03:58.2948] VERBOSE[410941] func_timeout.c: Channel will hangup at 2025-08-14 01:03:58.294 UTC." },
{ "line": "[2025-08-13 15:03:58.3929] VERBOSE[412538][C-000530ec] res_rtp_asterisk.c: 0x556ebcaaa000 -- Strict RTP learning complete - Locking on source address 10.0.4.75:19570" }
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment