# How can I import json data to elasticsearch?

**URL:** https://discuss.elastic.co/t/how-can-i-import-json-data-to-elasticsearch/169207
**Category:** Logstash
**Created:** [February 20, 2019, 12:21pm UTC](https://discuss.elastic.co/t/how-can-i-import-json-data-to-elasticsearch/169207 "2019-02-20T12:21:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![YK\_Lee](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@YK\_Lee](https://discuss.elastic.co/u/YK_Lee)
#### Post date: [February 20, 2019, 12:21pm UTC](https://discuss.elastic.co/t/how-can-i-import-json-data-to-elasticsearch/169207/1 "2019-02-20T12:21:11Z")

</div>

I wrote config file and excuted that  
but, I can't find the result in kibana(elasticsearch)  
I don't know what is wrong. help me ~  
I need your help.

this is my config file

* * *

```
input { 
	file {
	        
	 	path => "D:\2_elastic\NNIBR_bigdata\dbtest.json"
		start_position => "beginning"
		sincedb_path => "/dev/null"
		
		
        
	}
}

filter {
	json {
		source => "message"
		target => "parsedJSON"
		
	}
}
   

output { 
	

	elasticsearch {
		hosts => ["localhost:9200"]
		index => "json_test-%{+YYYY.MM.dd}"
		manage_template => false
		template_name => jsontest_template
	}

	stdout { codec => rubydebug}
   
}

```

* * *

and I get the result like below

* * *

```
Sending Logstash logs to 
C:/ElasticStack/logstash-6.6.1/logs which is now configured via log4j2.properties

[2019-02-20T21:05:57,539][WARN][logstash.config.source.multilocal] 
Ignoring the 'pipelines.yml' file because modules or command line options are specified

[2019-02-20T21:05:57,563][INFO][logstash.runner] 
Starting Logstash {"logstash.version"=>"6.6.1"}

[2019-02-20T21:06:02,749][INFO][logstash.pipeline]
 Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>8, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50}

[2019-02-20T21:06:03,228][INFO][logstash.outputs.elasticsearch]
 Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>[http://localhost:9200/]}}

[2019-02-20T21:06:03,441][WARN][logstash.outputs.elasticsearch] 
Restored connection to ES instance {:url=>"http://localhost:9200/"}

[2019-02-20T21:06:03,501][INFO][logstash.outputs.elasticsearch] 
ES Output version determined {:es_version=>6}

[2019-02-20T21:06:03,505][WARN][logstash.outputs.elasticsearch] 
Detected a 6.x and above cluster: the `type` event field won't be used to determine the document _type {:es_version=>6}

[2019-02-20T21:06:03,535][INFO][logstash.outputs.elasticsearch] 
New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["//localhost:9200"]}

[2019-02-20T21:06:03,554][INFO][logstash.outputs.elasticsearch] 
Index Lifecycle Management is set to 'auto', but will be disabled - Your Elasticsearch cluster is before 7.0.0, which is the minimum version required to automatically run Index Lifecycle Management

[2019-02-20T21:06:04,122][INFO][logstash.pipeline]
 Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x7c788499 run>"}

[2019-02-20T21:06:04,187][INFO][logstash.agent] 
Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}

[2019-02-20T21:06:04,197][INFO][filewatch.observingtail] 
START, creating Discoverer, Watch with file and sincedb collections

[2019-02-20T21:06:04,607][INFO][logstash.agent] 
Successfully started Logstash API endpoint {:port=>9600}

```

* * *

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [February 20, 2019, 12:35pm UTC](https://discuss.elastic.co/t/how-can-i-import-json-data-to-elasticsearch/169207/2 "2019-02-20T12:35:02Z")

</div>

> [@YK\_Lee](#):
>
> path =\> "D:\2\_elastic\NNIBR\_bigdata\dbtest.json"

Change that to

```
path => "D:/2_elastic/NNIBR_bigdata/dbtest.json"

```

---

<div class="post-metadata">

### Author: ![YK\_Lee](https://avatars.discourse-cdn.com/v4/letter/y/c0e974/32.png) [@YK\_Lee](https://discuss.elastic.co/u/YK_Lee)
#### Post date: [February 26, 2019, 3:34am UTC](https://discuss.elastic.co/t/how-can-i-import-json-data-to-elasticsearch/169207/3 "2019-02-26T03:34:08Z")

</div>

Thank you for your help  
I resolved it.

---

<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: [March 26, 2019, 3:34am UTC](https://discuss.elastic.co/t/how-can-i-import-json-data-to-elasticsearch/169207/4 "2019-03-26T03:34:27Z")

</div>

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