Here is my conf file look like:
input
{
file
{
codec => "json"
path => "/ci/data/cirrus/report/*/status.json"
start_position => "beginning"
sincedb_path => "/ci/data/cirrus/sincedb_path/status.db"
type => "STATUS"
ignore_older => 0
}
}
filter {
json {
source => "path"
add_field =>
{
"status" => "%{field1}"
"cirrus_id" => "%{field2}"
}
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
hosts => ["localhost:9200"]
index => "scan"
}
}
what's wrong with conf file?? and what should i write inorder to get certain fields from my json file.
my json file look like:
{
"status": "abort",
"time_start": 1494845194.7839701,
"agent_pid": 16466,
"id": "ci-000c2969deb0_administrator_1",
"time_queued": 1494845187.88799,
"time_end": 1494845194.8816111,
"message": "catch exception [[Errno 2] No such file or directory: u'/ci/data/cirrus/jobs/ci-000c2969deb0_administrator_1/input/job.json_from_(no suts defined)'];1 stage(s) failed",
"stages": {
"run_sys_cmd_sut": {
"status": "fail",
"message": "failed to connect to sut, unknown SUT OS type"
}
}
}
i want to store get "status", "id" , "time_queued " from the above json file as an output. for this what should i write in my filter part.