{"action":"created","issue":{"url":"https://api.github.com/repos/sivasamyk/logtrail/issues/302","repository_url":"https://api.github.com/repos/sivasamyk/logtrail","labels_url":"https://api.github.com/repos/sivasamyk/logtrail/issues/302/labels{/name}","comments_url":"https://api.github.com/repos/sivasamyk/logtrail/issues/302/comments","events_url":"https://api.github.com/repos/sivasamyk/logtrail/issues/302/events","html_url":"https://github.com/sivasamyk/logtrail/issues/302","id":349833848,"node_id":"MDU6SXNzdWUzNDk4MzM4NDg=","number":302,"title":"\"Error! Exception while fetching hosts : [object Object]\"","user":{"login":"caio1982","id":1158947,"node_id":"MDQ6VXNlcjExNTg5NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/1158947?v=4","gravatar_id":"","url":"https://api.github.com/users/caio1982","html_url":"https://github.com/caio1982","followers_url":"https://api.github.com/users/caio1982/followers","following_url":"https://api.github.com/users/caio1982/following{/other_user}","gists_url":"https://api.github.com/users/caio1982/gists{/gist_id}","starred_url":"https://api.github.com/users/caio1982/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caio1982/subscriptions","organizations_url":"https://api.github.com/users/caio1982/orgs","repos_url":"https://api.github.com/users/caio1982/repos","events_url":"https://api.github.com/users/caio1982/events{/privacy}","received_events_url":"https://api.github.com/users/caio1982/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-12T18:32:53Z","updated_at":"2018-09-08T14:36:01Z","closed_at":null,"author_association":"NONE","body":"I've installed Kibana 6.3.1 with Logtrail 0.1.29 and I get `Error! Exception while fetching hosts : [object Object]` with a broad red band when I go to the Logtrail page. Checking the Kibana instance I see this:\r\n\r\n```\r\n{\"type\":\"response\",\"@timestamp\":\"2018-08-12T18:24:55Z\",\"tags\":[],\"pid\":1,\"method\":\"get\",\"statusCode\":200,\"req\":{\"url\":\"/logtrail/config\",\"method\":\"get\",\"headers\":{\"host\":\"127.0.0.1:8080\",\"user-agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0\",\"accept\":\"application/json, text/plain, */*\",\"accept-language\":\"en-US,en;q=0.5\",\"accept-encoding\":\"gzip, deflate\",\"referer\":\"http://127.0.0.1:8080/app/logtrail\",\"kbn-version\":\"6.3.1\",\"dnt\":\"1\",\"connection\":\"keep-alive\"},\"remoteAddress\":\"127.0.0.1\",\"userAgent\":\"127.0.0.1\",\"referer\":\"http://127.0.0.1:8080/app/logtrail\"},\"res\":{\"statusCode\":200,\"responseTime\":10,\"contentLength\":9},\"message\":\"GET /logtrail/config 200 10ms - 9.0B\"}\r\n{\"type\":\"response\",\"@timestamp\":\"2018-08-12T18:24:55Z\",\"tags\":[],\"pid\":1,\"method\":\"get\",\"statusCode\":304,\"req\":{\"url\":\"/bundles/ebdca7741674eca4e1fadeca157f3ae6.svg\",\"method\":\"get\",\"headers\":{\"host\":\"127.0.0.1:8080\",\"user-agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0\",\"accept\":\"*/*\",\"accept-language\":\"en-US,en;q=0.5\",\"accept-encoding\":\"gzip, deflate\",\"referer\":\"http://127.0.0.1:8080/bundles/commons.style.css\",\"dnt\":\"1\",\"connection\":\"keep-alive\",\"if-modified-since\":\"Sun, 12 Aug 2018 18:12:17 GMT\",\"if-none-match\":\"\\\"eacd5acd1258d9b09e78dbc1958744f30e38bcbd-gzip\\\"\"},\"remoteAddress\":\"127.0.0.1\",\"userAgent\":\"127.0.0.1\",\"referer\":\"http://127.0.0.1:8080/bundles/commons.style.css\"},\"res\":{\"statusCode\":304,\"responseTime\":2,\"contentLength\":9},\"message\":\"GET /bundles/ebdca7741674eca4e1fadeca157f3ae6.svg 304 2ms - 9.0B\"}\r\nError while fetching hosts TypeError: Cannot read property 'hosts' of undefined\r\n    at /usr/share/kibana/plugins/logtrail/server/routes/server.js:248:35\r\n    at bound (domain.js:301:14)\r\n    at runBound (domain.js:314:12)\r\n    at tryCatcher (/usr/share/kibana/node_modules/bluebird/js/main/util.js:26:23)\r\n    at Promise._settlePromiseFromHandler (/usr/share/kibana/node_modules/bluebird/js/main/promise.js:503:31)\r\n    at Promise._settlePromiseAt (/usr/share/kibana/node_modules/bluebird/js/main/promise.js:577:18)\r\n    at Promise._settlePromises (/usr/share/kibana/node_modules/bluebird/js/main/promise.js:693:14)\r\n    at Async._drainQueue (/usr/share/kibana/node_modules/bluebird/js/main/async.js:123:16)\r\n    at Async._drainQueues (/usr/share/kibana/node_modules/bluebird/js/main/async.js:133:10)\r\n    at Immediate.Async.drainQueues (/usr/share/kibana/node_modules/bluebird/js/main/async.js:15:14)\r\n    at runCallback (timers.js:810:20)\r\n    at tryOnImmediate (timers.js:768:5)\r\n    at processImmediate [as _immediateCallback] (timers.js:745:5)\r\n{\"type\":\"response\",\"@timestamp\":\"2018-08-12T18:24:56Z\",\"tags\":[],\"pid\":1,\"method\":\"post\",\"statusCode\":200,\"req\":{\"url\":\"/logtrail/hosts\",\"method\":\"post\",\"headers\":{\"host\":\"127.0.0.1:8080\",\"user-agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0\",\"accept\":\"application/json, text/plain, */*\",\"accept-language\":\"en-US,en;q=0.5\",\"accept-encoding\":\"gzip, deflate\",\"referer\":\"http://127.0.0.1:8080/app/logtrail\",\"content-type\":\"application/json;charset=utf-8\",\"kbn-version\":\"6.3.1\",\"content-length\":\"500\",\"dnt\":\"1\",\"connection\":\"keep-alive\"},\"remoteAddress\":\"127.0.0.1\",\"userAgent\":\"127.0.0.1\",\"referer\":\"http://127.0.0.1:8080/app/logtrail\"},\"res\":{\"statusCode\":200,\"responseTime\":10,\"contentLength\":9},\"message\":\"POST /logtrail/hosts 200 10ms - 9.0B\"}\r\n{\"type\":\"response\",\"@timestamp\":\"2018-08-12T18:24:56Z\",\"tags\":[],\"pid\":1,\"method\":\"post\",\"statusCode\":200,\"req\":{\"url\":\"/logtrail/search\",\"method\":\"post\",\"headers\":{\"host\":\"127.0.0.1:8080\",\"user-agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0\",\"accept\":\"application/json, text/plain, */*\",\"accept-language\":\"en-US,en;q=0.5\",\"accept-encoding\":\"gzip, deflate\",\"referer\":\"http://127.0.0.1:8080/app/logtrail\",\"content-type\":\"application/json;charset=utf-8\",\"kbn-version\":\"6.3.1\",\"content-length\":\"614\",\"dnt\":\"1\",\"connection\":\"keep-alive\"},\"remoteAddress\":\"127.0.0.1\",\"userAgent\":\"127.0.0.1\",\"referer\":\"http://127.0.0.1:8080/app/logtrail\"},\"res\":{\"statusCode\":200,\"responseTime\":9,\"contentLength\":9},\"message\":\"POST /logtrail/search 200 9ms - 9.0B\"}\r\n```\r\n\r\nI am testing it on Kubernetes with the following Docker image setup (available through my Docker Hub if needed for testing):\r\n\r\n```\r\nFROM docker.elastic.co/kibana/kibana-oss:6.3.1\r\nMAINTAINER caio1982\r\nRUN ./bin/kibana-plugin install https://github.com/sivasamyk/logtrail/releases/download/v0.1.29/logtrail-6.3.1-0.1.29.zip\r\n```\r\n\r\nWithout Logtrail the same Kibana setup works normally. Even though I see `{\"type\":\"log\",\"@timestamp\":\"2018-08-12T18:24:55Z\",\"tags\":[\"info\",\"status\"],\"pid\":1,\"message\":\"Error while loading config from Elasticsearch. Will use local\"}` in the log, all seems good and working without Logtrail.\r\n\r\nMy indices are all `logstash-*`.\r\n\r\nAny idea, folks? :-("},"comment":{"url":"https://api.github.com/repos/sivasamyk/logtrail/issues/comments/419646471","html_url":"https://github.com/sivasamyk/logtrail/issues/302#issuecomment-419646471","issue_url":"https://api.github.com/repos/sivasamyk/logtrail/issues/302","id":419646471,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTY0NjQ3MQ==","user":{"login":"sivasamyk","id":1464186,"node_id":"MDQ6VXNlcjE0NjQxODY=","avatar_url":"https://avatars0.githubusercontent.com/u/1464186?v=4","gravatar_id":"","url":"https://api.github.com/users/sivasamyk","html_url":"https://github.com/sivasamyk","followers_url":"https://api.github.com/users/sivasamyk/followers","following_url":"https://api.github.com/users/sivasamyk/following{/other_user}","gists_url":"https://api.github.com/users/sivasamyk/gists{/gist_id}","starred_url":"https://api.github.com/users/sivasamyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sivasamyk/subscriptions","organizations_url":"https://api.github.com/users/sivasamyk/orgs","repos_url":"https://api.github.com/users/sivasamyk/repos","events_url":"https://api.github.com/users/sivasamyk/events{/privacy}","received_events_url":"https://api.github.com/users/sivasamyk/received_events","type":"User","site_admin":false},"created_at":"2018-09-08T14:36:01Z","updated_at":"2018-09-08T14:36:01Z","author_association":"OWNER","body":"Thanks for the info. I see you are using the default logtrail.json. Can you check the mapping in ES for `filebeat-*` index and check if `beat.hostname.keyword` mapping is present? Can you share the result of the following query?\r\n\r\n```sh\r\ncurl -XPOST -H \"Content-Type:application/json\" localhost:9200/filebeat-*/_search -d ' { \"size\" : 0, \"aggs\": { \"hosts\": { \"terms\" : { \"field\" : \"beat.hostname.keyword\" } } } }'\r\n```"}}
{"actor":{"display_login":"sivasamyk"}}