Filter basic file with Logstash

Hello, I have a blocklist.txt which contains IP address in the following structure:
192.168.100.77
192.168.100.66

How can I create JSON with Logstash with a similar output:
{
IP: 192.168.100.77,
IP: 192.168.100.66
}

Do you want to convert a set of lines in a file into a single line of JSON? Do you consider duplicate keys to be valid?

Not a single JSON line.
{
IP: 192.168.100.77,
},
{
IP: 192.168.100.66
}

What output are you going to use? It might be as simple as

filter { mutate { rename => { "message" => "IP" } } }
output { file { path => "/home/user/foo.txt" codec => json } }

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.