1

i want to remove all new line in Postgresql log before sent them to Graylog. Example,

2018-08-30 00:00:00 WIB [29212] hi_user@myDatabase 172.21.253.44 LOG:  duration: 1044.000 ms  execute 32:
                            SELECT
                                    talk_id,
                                    product_id,
                                    shop_id,
                                    user_id,
                                    message,
                                    total_comment,
                                    create_time,
                                    status,
                                    fraud_status
                            FROM
                                    ws_talk
                            WHERE
                                    ws_talk.status = 1 AND ws_talk.product_id IN(298932598,309360018,300809172,309360017,300809175,300809174,300809173,298932597,25748655) AND create_time > '2018-01-01 00:00:00'
                                            AND ws_talk.shop_id = 216771
                            ORDER BY talk_id DESC
                            LIMIT 11 OFFSET 0

That should be like this

2018-08-30 00:00:00 WIB [29212] hi_user@myDatabase 172.21.253.44 LOG:  duration: 1044.000 ms  execute 32:
SELECT talk_id, product_id, shop_id, user_id, message, total_comment, create_time, status, fraud_status FROM ws_talk WHERE ws_talk.status = 1 AND ws_talk.product_id IN(298932598,309360018,300809172,309360017,300809175,300809174,300809173,298932597,25748655) AND create_time > '2018-01-01 00:00:00' AND ws_talk.shop_id = 216771 ORDER BY talk_id DESC LIMIT 11 OFFSET 0

I think, it's better.

And this is how it looks like in Graylog Postgresql in Graylog

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.