我正在尝试为 postgresql 日志创建过滤器。日志记录可以是单行的,例如
2014-01-14 17:23:08 EST DETAIL: Remote detail: Key (id)=(913072088342860500) already exists.
或多线:
2014-02-04 19:26:08 EST CONTEXT: Remote context: SQL statement "INSERT INTO images.images_contents_part_2014_01_05 SELECT $1.*"
PL/pgSQL function insert_find_part() line 25 at EXECUTE statement
SQL statement "INSERT INTO images.images_contents_master SELECT NEW.*"
PL/pgSQL function images_contents_insert_trigger() line 6 at SQL statement
SQL statement "INSERT INTO images.images_contents (id,content_id, image, created)
VALUES (images.images_make_id_from_created(created_at),content_id, image_path, created_at)
RETURNING id"
PL/pgSQL function insert_news_image(character varying,bigint,timestamp without time zone) line 11 at SQL statement
SQL statement "SELECT
media_id AS id
FROM contents.insert_news_image(i, id) AS media_id"
PL/pgSQL function insert_news_media(bigint,character varying[],character varying[]) line 21 at SQL statement
我需要提取有关时间、消息类型(上下文、详细信息、调试等)和消息文本的信息。我想需要使用多行编解码器,但我不知道如何实现它。
谢谢!