{"action":"created","issue":{"url":"https://api.github.com/repos/fluent/fluent-bit/issues/804","repository_url":"https://api.github.com/repos/fluent/fluent-bit","labels_url":"https://api.github.com/repos/fluent/fluent-bit/issues/804/labels{/name}","comments_url":"https://api.github.com/repos/fluent/fluent-bit/issues/804/comments","events_url":"https://api.github.com/repos/fluent/fluent-bit/issues/804/events","html_url":"https://github.com/fluent/fluent-bit/issues/804","id":364769590,"node_id":"MDU6SXNzdWUzNjQ3Njk1OTA=","number":804,"title":"Fluent-bit not reading logs from java application","user":{"login":"NicholasK13","id":19207528,"node_id":"MDQ6VXNlcjE5MjA3NTI4","avatar_url":"https://avatars3.githubusercontent.com/u/19207528?v=4","gravatar_id":"","url":"https://api.github.com/users/NicholasK13","html_url":"https://github.com/NicholasK13","followers_url":"https://api.github.com/users/NicholasK13/followers","following_url":"https://api.github.com/users/NicholasK13/following{/other_user}","gists_url":"https://api.github.com/users/NicholasK13/gists{/gist_id}","starred_url":"https://api.github.com/users/NicholasK13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicholasK13/subscriptions","organizations_url":"https://api.github.com/users/NicholasK13/orgs","repos_url":"https://api.github.com/users/NicholasK13/repos","events_url":"https://api.github.com/users/NicholasK13/events{/privacy}","received_events_url":"https://api.github.com/users/NicholasK13/received_events","type":"User","site_admin":false},"labels":[{"id":626886511,"node_id":"MDU6TGFiZWw2MjY4ODY1MTE=","url":"https://api.github.com/repos/fluent/fluent-bit/labels/not-an-issue","name":"not-an-issue","color":"c2e0c6","default":false},{"id":171021301,"node_id":"MDU6TGFiZWwxNzEwMjEzMDE=","url":"https://api.github.com/repos/fluent/fluent-bit/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"edsiper","id":369718,"node_id":"MDQ6VXNlcjM2OTcxOA==","avatar_url":"https://avatars3.githubusercontent.com/u/369718?v=4","gravatar_id":"","url":"https://api.github.com/users/edsiper","html_url":"https://github.com/edsiper","followers_url":"https://api.github.com/users/edsiper/followers","following_url":"https://api.github.com/users/edsiper/following{/other_user}","gists_url":"https://api.github.com/users/edsiper/gists{/gist_id}","starred_url":"https://api.github.com/users/edsiper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsiper/subscriptions","organizations_url":"https://api.github.com/users/edsiper/orgs","repos_url":"https://api.github.com/users/edsiper/repos","events_url":"https://api.github.com/users/edsiper/events{/privacy}","received_events_url":"https://api.github.com/users/edsiper/received_events","type":"User","site_admin":false},"assignees":[{"login":"edsiper","id":369718,"node_id":"MDQ6VXNlcjM2OTcxOA==","avatar_url":"https://avatars3.githubusercontent.com/u/369718?v=4","gravatar_id":"","url":"https://api.github.com/users/edsiper","html_url":"https://github.com/edsiper","followers_url":"https://api.github.com/users/edsiper/followers","following_url":"https://api.github.com/users/edsiper/following{/other_user}","gists_url":"https://api.github.com/users/edsiper/gists{/gist_id}","starred_url":"https://api.github.com/users/edsiper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edsiper/subscriptions","organizations_url":"https://api.github.com/users/edsiper/orgs","repos_url":"https://api.github.com/users/edsiper/repos","events_url":"https://api.github.com/users/edsiper/events{/privacy}","received_events_url":"https://api.github.com/users/edsiper/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2018-09-28T07:18:13Z","updated_at":"2018-10-01T13:13:06Z","closed_at":null,"author_association":"NONE","body":"Issue:\r\nI'm trying to send logs from my java application to fluent-bit which is present on a remote photon-os based machine. I'm using logback for implementing it.\r\n\r\n```\r\npublic class App {\r\n  private final static Logger logger = LoggerFactory.getLogger(App.class);\r\n\r\n  public static void main(String[] args) {\r\n   for (int i = 0; ; i++) {\r\n      logger.debug(\"Warn msg\");\r\n      try {\r\n         Thread.sleep(5000);\r\n       } catch (InterruptedException e) {\r\n        // do nothing now\r\n      }\r\n   }\r\n }\r\n}\r\n```\r\n\r\nlogback.xml\r\n\r\n       \r\n```\r\n<configuration>\r\n\r\n\t<!-- for JSON logs -->\r\n\t<appender name=\"json\" class=\"ch.qos.logback.core.ConsoleAppender\">\r\n\t\t<layout class=\"ch.qos.logback.contrib.json.classic.JsonLayout\">\r\n\t\t\t<jsonFormatter class=\"ch.qos.logback.contrib.jackson.JacksonJsonFormatter\">\r\n\t\t\t\t<prettyPrint>true</prettyPrint>\r\n\t\t\t</jsonFormatter>\r\n\t\t\t<timestampFormat>yyyy-MM-dd' 'HH:mm:ss.SSS</timestampFormat>\r\n\t\t</layout>\r\n\t</appender>\r\n\r\n        <!-- for FLUENTD logs -->\r\n\t<appender name=\"fluentd\" class=\"ch.qos.logback.more.appenders.DataFluentAppender\">\r\n\r\n\t\t<remoteHost>xx.xxx.xxx.xxx</remoteHost>\r\n\t\t<port>7777</port>\r\n\r\n\t\t<layout class=\"ch.qos.logback.contrib.json.classic.JsonLayout\">\r\n\t\t\t<jsonFormatter class=\"ch.qos.logback.contrib.jackson.JacksonJsonFormatter\">\r\n\t\t\t</jsonFormatter>\r\n\t\t\t<timestampFormat>yyyy-MM-dd' 'HH:mm:ss.SSS</timestampFormat>\r\n\t\t</layout>\r\n\r\n\t</appender>\r\n\r\n        <root level=\"TRACE\">\r\n\t\t<appender-ref ref=\"fluentd\" />\r\n\t\t<appender-ref ref=\"json\" />\r\n\t</root>\r\n</configuration>\r\n```\r\n\r\nThis is what gets printed in my console using the json appender\r\n_{\"timestamp\":\"2018-09-28 12:41:03.394\",\"level\":\"DEBUG\",\"thread\":\"main\",\"logger\":\"org.efk.com.App\",\"message\":\"logging and logging\",\"context\":\"default\"}_\r\n\r\nHere's the fluent-bit configuration : \r\ntd-agent-bit.conf\r\n\r\n```\r\n[INPUT]\r\n    Name          tcp\r\n    Listen        xx.xxx.xxx.xxx\r\n    Port          7777\r\n    Chunk_Size    1024\r\n    Buffer_Size   2048\r\n\r\n[OUTPUT]\r\n    Name          stdout\r\n```\r\n\r\nWhen i see the logs I get this exception \r\n\r\n_[2018/09/28 07:04:48] [trace] [in_tcp] read()=93 pre_len=0 now_len=93\r\n[2018/09/28 07:04:48] [debug] [in_serial] invalid JSON message, skipping\r\n[2018/09/28 07:04:53] [trace] [in_tcp] read()=93 pre_len=93 now_len=186\r\n[2018/09/28 07:04:53] [debug] [in_serial] invalid JSON message, skipping_\r\n\r\nAlso I am able to see the output when I test my configuration from the command line via \r\n_echo '{\"key 1\": 10, \"key 2\": \"YYY\"}' | nc xx.xxx.xxx.xxx 7777_\r\nThis outputs : \r\n_[0] tcp.0: [1538116716.154995913, {\"key 1\"=>10, \"key 2\"=>\"YYY\"}]_\r\n\r\nI'm able to print the logs in my console and it indeed is in valid format. I've been cracking my head for 2 days on this, any help is highly appreciated."},"comment":{"url":"https://api.github.com/repos/fluent/fluent-bit/issues/comments/425902465","html_url":"https://github.com/fluent/fluent-bit/issues/804#issuecomment-425902465","issue_url":"https://api.github.com/repos/fluent/fluent-bit/issues/804","id":425902465,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTkwMjQ2NQ==","user":{"login":"NicholasK13","id":19207528,"node_id":"MDQ6VXNlcjE5MjA3NTI4","avatar_url":"https://avatars3.githubusercontent.com/u/19207528?v=4","gravatar_id":"","url":"https://api.github.com/users/NicholasK13","html_url":"https://github.com/NicholasK13","followers_url":"https://api.github.com/users/NicholasK13/followers","following_url":"https://api.github.com/users/NicholasK13/following{/other_user}","gists_url":"https://api.github.com/users/NicholasK13/gists{/gist_id}","starred_url":"https://api.github.com/users/NicholasK13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicholasK13/subscriptions","organizations_url":"https://api.github.com/users/NicholasK13/orgs","repos_url":"https://api.github.com/users/NicholasK13/repos","events_url":"https://api.github.com/users/NicholasK13/events{/privacy}","received_events_url":"https://api.github.com/users/NicholasK13/received_events","type":"User","site_admin":false},"created_at":"2018-10-01T13:13:06Z","updated_at":"2018-10-01T13:13:06Z","author_association":"NONE","body":"**@edsiper** \r\n\r\nAh okay that worked. Thanks for your time. I was trying to use fluent-bit for HA and as per [this](https://github.com/fluent/fluent-bit/issues/565) it doesn't offer any features like fluentd. Can you please let me know if fluent-bit has added any more features or is fluentd better when it comes to HA?"}}
{"actor":{"display_login":"NicholasK13"}}