Uploading Json file to ES using LogStash

I have a very simple Json file:

{"ABC":"123","DEF":"456"}

I'm trying to upload that to Elastic Search using LogStash. My LogStash config file is:

input {
file {
start_position => "beginning"
path => "C:\Docs\Elastic_Search\simple_json.json"
codec => "json"
sincedb_path => "/dev/null"
type => "data"
}
}
output {
elasticsearch {
hosts => "localhost:9200"
index => "test_json"
document_type => "test_search_json"
}
stdout { codec => rubydebug }
}

However, when I start LogStash (logstash -f logstash-simple_json.conf --debug), the data does not get uploaded to Elastic Search.

I get the following:

[2017-08-01T08:02:51,342][DEBUG][logstash.inputs.file ] C:\Docs\Elastic_Search\simple_json.json:
sincedb last value 0, cur size 25
[2017-08-01T08:02:51,343][DEBUG][logstash.inputs.file ] C:\Docs\Elastic_Search\simple_json.json:
sincedb: seeking to 0
[2017-08-01T08:02:51,344][DEBUG][logstash.inputs.file ] writing sincedb (delta since last write
= 1501599771)
[2017-08-01T08:02:51,346][DEBUG][logstash.inputs.file ] :delete for C:\Docs\Elastic_Search\simpl
e_json.json, closing file
[2017-08-01T08:02:56,284][DEBUG][logstash.pipeline ] Pushing flush onto pipeline
[2017-08-01T08:03:01,284][DEBUG][logstash.pipeline ] Pushing flush onto pipeline
[2017-08-01T08:03:05,349][DEBUG][logstash.inputs.file ] _globbed_files: C:\Docs\Elastic_Search\s
imple_json.json: glob is: []
[2017-08-01T08:03:05,350][DEBUG][logstash.inputs.file ] _globbed_files: C:\Docs\Elastic_Search\s
imple_json.json: glob is: ["C:\Docs\Elastic_Search\simple_json.json"] because glob did not work
[2017-08-01T08:03:05,351][DEBUG][logstash.inputs.file ] _discover_file: C:\Docs\Elastic_Search\s
imple_json.json: new: C:\Docs\Elastic_Search\simple_json.json (exclude is [])
[2017-08-01T08:03:06,283][DEBUG][logstash.pipeline ] Pushing flush onto pipeline
[2017-08-01T08:03:06,356][DEBUG][logstash.inputs.file ] _open_file: C:\Docs\Elastic_Search\simpl
e_json.json: opening
[2017-08-01T08:03:06,358][DEBUG][logstash.inputs.file ] C:\Docs\Elastic_Search\simple_json.json:
sincedb last value 0, cur size 25
[2017-08-01T08:03:06,359][DEBUG][logstash.inputs.file ] C:\Docs\Elastic_Search\simple_json.json:
sincedb: seeking to 0
[2017-08-01T08:03:06,360][DEBUG][logstash.inputs.file ] writing sincedb (delta since last write
= 1501599786)
[2017-08-01T08:03:06,362][DEBUG][logstash.inputs.file ] :delete for C:\Docs\Elastic_Search\simpl
e_json.json, closing file
[2017-08-01T08:03:11,283][DEBUG][logstash.pipeline ] Pushing flush onto pipeline
[2017-08-01T08:03:16,282][DEBUG][logstash.pipeline ] Pushing flush onto pipeline
[2017-08-01T08:03:20,365][DEBUG][logstash.inputs.file ] _globbed_files: C:\Docs\Elastic_Search\s
imple_json.json: glob is: []

Is there something wrong with my config file?
What is the easiest way to upload a Json file to Elastic Search using LogStash?

Thanks in advance!

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