I have a dir with tons of subdirs with a json file like this:
{
"id": "2234",
"name": "Text",
"url": "https://url.com",
"param": "string",
"last": "2021-07-06 20:05:49.458724",
"url2": "url.com"
}
I've tried all things I'm able to search, actually I'm with this L config:
# Input section
input {
file {
type => "json"
codec => multiline { pattern => "^Spalanzani" what => "previous" negate => true auto_flush_interval => 1 }
path => "path/**/*.json"
start_position => "beginning"
sincedb_path => "path.log"
}
}
#filter section
filter {
json {
source => "message"
}
mutate {
remove_field => ["host", "@version", "type", "path", "tags", "@timestamp"]
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "myIndex"
user => "usr"
password => "mypwd"
}
stdout {codec => rubydebug}
}
Don't know te reason but I'm sure that some time ago I was able to ingest a json file much more complex simply setting up type and condec to "json".... With previous config I get a message field filled with all fields, without last }, Why?
Any idea suggestion? Thanks.