How to match multi-line text in mtail (e.g., for PostgreSQL CSV logs with multi-line statements)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- postgresql
調査の方向性
まず、mtail の行単位のログ処理と、複数行マッチングまたはバッファリングに関する既存のドキュメントを確認します。PostgreSQL CSV の例を使って、複数行のステートメントを蓄積できるかどうかを判断します。完了条件は、サポートされている方法を文書化するか、明確に説明された回避策を示すことです。
索引モデルが issue の本文から書いたものです。
説明
I'm currently working on monitoring PostgreSQL logs in CSV format using mtail. One challenge is that SQL statements in the statement field may span multiple lines. This makes it difficult to extract meaningful labels or metrics using mtail, since it appears to process logs line-by-line.
For example, a single statement field in a PostgreSQL log might contain embedded newlines like this:
2025-06-26 01:47:40.578 CST,,,2348220,,685c3414.23d4bc,1,,2025-06-26 01:38:28 CST,509/2455864,0,LOG,00000,"automatic vacuum of table ""bdc.pg_catalog.pg_attribute"": index scans: 1
pages: 0 removed, 2420645 remain, 0 skipped due to pins, 2391644 skipped frozen
tuples: 18257 removed, 1605338 remain, 1419055 are dead but not yet removable, oldest xmin: 3862849561
buffer usage: 1441377 hits, 1443437 misses, 2468 dirtied
avg read rate: 22.069 MB/s, avg write rate: 0.038 MB/s
system usage: CPU: user: 9.42 s, system: 8.80 s, elapsed: 510.99 s",,,,,,,,,""
I’m wondering:
- Does mtail support any way to accumulate or buffer multiple lines to allow multi-line matching?
- If not directly supported, are there recommended workarounds for this scenario?
This would be very helpful when we want to extract meaningful metrics or tags (e.g., command type, table name) from full SQL statements for observability purposes.
Thanks in advance for your guidance!
- 主要言語
- Go
- スター
- 4k
- フォーク
- 396
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
JakeChampion/lang#14392 ·
メンテナーはふだん 1 日以内に返信
-
agent-butler-finding bug
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
jordansmall/spindrift#6557 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Custom tool truncation leaves unused stream copies open対応中かも @OUAO-FRANK が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyオープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
crmne/hyprmoncfg#114 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信