# Uploading Json file to ES using LogStash

**URL:** <https://discuss.elastic.co/t/uploading-json-file-to-es-using-logstash/95370>\
**Category:** Logstash\
**Created:** [August 1, 2017, 3:11pm UTC](https://discuss.elastic.co/t/uploading-json-file-to-es-using-logstash/95370 "2017-08-01T15:11:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SKim](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@SKim](https://discuss.elastic.co/u/SKim)\
**Post date:** [August 1, 2017, 3:11pm UTC](https://discuss.elastic.co/t/uploading-json-file-to-es-using-logstash/95370/1 "2017-08-01T15:11:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 29, 2017, 3:12pm UTC](https://discuss.elastic.co/t/uploading-json-file-to-es-using-logstash/95370/2 "2017-08-29T15:12:04Z")

</div>

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