Trouble importing json log file to ELK via Elasticsearch (or other method)

I've been fighting this for a while now and may have run into a bit of a roadblock.

PROBLEM: I'm trying to import 5GB worth of Zeek/Bro logs (see sample log below)


  • I've tried to use CURL to send the logs over, that didn't seem to go, I might be doing something wrong.
  • I tried to use jsonpyes but that was having trouble, it looks like there might be a bug in the current code around UTF-8.
  • I set up filebeat and put the logfile.json into a folder, enabled the zeek/bro module and that imported the file and all the entries but pre-pended everything with filebeat import messages rather than only the json that's included below.

Can anyone point me in the right direction to accomplish getting entries like those below into an ELK stack through elasticsearch? If there's a better direction to go with importing the data please let me know I'm happy to try other directions.



You can use Logstash to import file into Elasticsearch.

input {
file {
type => "json"
path => "/opt/samplejson.json"
start_position => "beginning"

filter {
json {
source => "message"

output {
stdout {


Thank you for the reply.

I am a little new to this so I apologize. You mean that I can:

  1. create a logstash config with that in it.
  2. run logstash from command line, specifying the config file that was created.
  3. it will then run and parse each of the json entries without any more activity.

Is this the correct understanding?

Yes. More, you should prepare the index template before indexing if you don't want to use default index mapping

Okay, that is helpful. :smiley:

I do not know what you mean by "index template". Can you share an example of what it could look like?

When you put a document into a non-exist index, Elasticsearch will create index automatically and apply default mapping(schema) on it. You can manage mapping if you don't want to use default mapping. Index template is convenient to define template which will be applied when new index is created.
define a template:

PUT _template/template_1
  "index_patterns": ["te*", "bar*"],
  "settings": {
    "number_of_shards": 1
  "mappings": {
    "_source": {
      "enabled": false
    "properties": {
      "host_name": {
        "type": "keyword"
      "created_at": {
        "type": "date",
        "format": "EEE MMM dd HH:mm:ss Z yyyy"

above template will be applied when te* or "bar* pattern indices are created.

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