Hi,
I want to stream logs from Postgres to elk but it doesn't parse the log properly.
Logstash.conf file:
input {
file {
path => "/path/to/log.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
quote_char => '"'
columns => [
"field_1",
"field_2",
"field_3",
"field_4",
"field_5"
]
}
}
output {
elasticsearch {
hosts => "localhost"
index => "test1"
}
}
Example of csv file input:
2025-07-22T15:10:00:0000,...,
"SELECT
c.customer_id,
c.name AS customer_name,
DATE_TRUNC('month', o.order_date) AS month,
SUM(oi.quantity * oi.unit_price) AS total_spent
FROM
customers c
JOIN orders o ON c.customer_id = o.customer_id
JOIN order_items oi ON o.order_id = oi.order_id
WHERE
o.order_date >= NOW() - INTERVAL '12 months'
GROUP BY
c.customer_id,
c.name,
month",
...
Any suggestions would be appreciated.
Thanks