sivasamyk / logtrail

Kibana plugin to view, search & live tail log events
MIT License
1.4k stars 185 forks source link

Error! Exception while fetching hosts : [object Object] #298

Closed olegantonyan closed 6 years ago

olegantonyan commented 6 years ago

I'm trying to install elk stack with logtrail Dockerfile:

FROM sebp/elk

WORKDIR ${KIBANA_HOME}
RUN gosu kibana bin/kibana-plugin install https://github.com/sivasamyk/logtrail/releases/download/v0.1.29/logtrail-6.3.2-0.1.29.zip
ADD logtrail.json /opt/kibana/installedPlugins/logtrail/logtrail.json
RUN chown kibana:kibana /opt/kibana/installedPlugins/logtrail/logtrail.json

Build it docker build -t elk-logtrail . Run docker run -p 5601:5601 -p 9200:9200 -p 5044:5044 -it --rm --name elk elk-logtrail Send a few messages via /opt/logstash/bin/logstash --path.data /tmp/logstash/data -e 'input { stdin { } } output { elasticsearch { hosts => ["localhost"] } }'

Then in Kibana's web ui I create an index pattern * without time field. Now I can see my messages on Kibana's discover page.

logtrail.json:

  "index_patterns" : [
    {
      "es": {
        "default_index": "*",
        "allow_url_parameter": false
      },
      "tail_interval_in_seconds": 10,
      "es_index_time_offset_in_seconds": 0,
      "display_timezone": "Etc/UTC",
      "display_timestamp_format": "MMM DD HH:mm:ss",
      "max_buckets": 500,
      "default_time_range_in_days" : 0,
      "max_hosts": 100,
      "max_events_to_keep_in_viewer": 5000,
      "fields" : {
        "mapping" : {
            "timestamp" : "@timestamp",
            "display_timestamp" : "@timestamp",
            "hostname" : "host",
            "program": "program",
            "message": "message"
        },
        "message_format": "{{{message}}}"
      },
      "color_mapping" : {
        "field": "level",
        "mapping" : {
          "0": "#ff0000",
          "1": "#ff3232",
          "2": "#ff4c4c",
          "3": "#ff7f24",
          "4": "#ffb90f",
          "5": "#a2cd5a"
        }
      }
    }
  ]
}

But logtrail gives me an error after loading page Error! Exception while fetching hosts : [object Object] In js console:

Error while fetching hosts :  
Object {  }
logtrail.bundle.js:3:31834
setupHostsList/<
http://localhost:5601/bundles/logtrail.bundle.js:3:31834
processQueue
http://localhost:5601/bundles/vendors.bundle.js:133:134252
scheduleProcessQueue/<
http://localhost:5601/bundles/vendors.bundle.js:133:135201
$digest
http://localhost:5601/bundles/vendors.bundle.js:133:146077
$apply
http://localhost:5601/bundles/vendors.bundle.js:133:148845
done
http://localhost:5601/bundles/vendors.bundle.js:133:101113
completeRequest
http://localhost:5601/bundles/vendors.bundle.js:133:106024
createHttpBackend/</xhr.onload
http://localhost:5601/bundles/vendors.bundle.js:133:106783
olegantonyan commented 6 years ago

Solved. logtrail.json must go to plugins, not installedPlugins

ADD logtrail.json /opt/kibana/plugins/logtrail/logtrail.json
RUN chown kibana:kibana /opt/kibana/plugins/logtrail/logtrail.json