On my macbook monterey 12.2.1, I get quoted JSON. I'm hoping for plain JSON.
logstash.yml is
node.name: tester
file.conf is
input {
file {
path => ["/Users/geena.rollins/ws/hello.json"]
start_position => "beginning"
sincedb_path => "/dev/null"
codec => "json"
type => "json"
}
}
filter {
mutate {
add_field => { "z" => "Yes" }
}
}
output {
stdout { codec => rubydebug }
file {
path => "/Users/geena.rollins/ws/result-0.json"
codec => "json_lines"
}
}
hello.json is:
{ "x": "Hello, world!!!", "y": 7 }
I'm hoping to get this output:
{ "x": "Hello, world!!!", "y": 7, "z": "Yes" }
But I get this:
{"z":"Yes","y":7,"log":{"file":{"path":"/Users/geena.rollins/ws/hello.json"}},"host":{"name":"basin"},"type":"json","@version":"1","event":{"original":"{ \"x\": \"Hello, world!!!\", \"y\": 7 }"},"@timestamp":"2022-03-29T04:26:50.051510Z","x":"Hello, world!!!"}
{
"z" => "Yes",
"y" => 7,
"log" => {
"file" => {
"path" => "/Users/geena.rollins/ws/hello.json"
}
},
"host" => {
"name" => "basin"
},
"type" => "json",
"@version" => "1",
"event" => {
"original" => "{ \"x\": \"Hello, world!!!\", \"y\": 7 }"
},
"@timestamp" => 2022-03-29T04:26:50.051510Z,
"x" => "Hello, world!!!"
}
Thank you for your advice.