John Doe
John Doe

Reputation: 10183

Import text file in Elasticsearch

I'd like to import a text file in Elasticsearch. The text file contains a single (hash)value per line. After spending several hours of struggling, I didn't get it done. Help is greatly appreciated.

Elasticsearch 5.1.2 with Logstash installed.

Sample data:

2d75cc1bf8e57872781f9cd04a529256
00f538c3d410822e241486ca061a57ee
3f066dd1f1da052248aed5abc4a0c6a1
781770fda3bd3236d0ab8274577dddde
86b6c59aa48a69e16d3313d982791398

Need just one index 'hashes', type 'md5'

Upvotes: 0

Views: 3949

Answers (2)

ofarukcaki
ofarukcaki

Reputation: 111

You can use duckimport, it's similar to Logstash but easy to use. I'm the developer of that

Upvotes: 2

cinhtau
cinhtau

Reputation: 1042

Well if you have logstash, import it with logstash.

Example config:

input {
   file {
      path => "/path/myfile"
      start_position => "beginning"
      type => "md5"
   }
}
output {
   elasticsearch {
       index => "hashes"
   }
}

assuming you run logstash on the same instance as elasticsearch.

Upvotes: 1

Related Questions