GitHub user xvjie opened a pull request: https://github.com/apache/flume/pull/201
ãä¹±ç é®é¢ãcharacters are not displayed properly____execSource.java I hope to confirm the following questions: When I use execSource to get data to elasticsearchSink: The source uses the "GBK" encoding, and the data on the es side will be garbled. I think: When the exec source configuration code is "GBK", the data should be encoded as "UTF-8" after reading the data, because the elasticsearchSink side does not have a code configuration. So I made the following changes to execSource.java in my personal use: eventList.add(EventBuilder.withBody(line.getBytes("UTF-8"))); --------------------------------------------------------------------------------------------è±æè¡¨è¾¾ä¸æ¸ æ¥çè¯ï¼ä»¥ä¸æ¯æ±è¯åæ æå¨ä½¿ç¨execSourceè·åæ°æ®å°elasticsearchSinkæ¶ï¼ source使ç¨âGBKâç¼ç ï¼esç«¯çæ°æ®ä¼ä¹±ç ã æè®¤ä¸ºï¼ execæºç«¯é ç½®ç¼ç 为âGBKâæ¶ï¼å¨è¯»åå°æ°æ®ä»¥ååºè¯¥å°æ°æ®ç¼ç 为"UTF-8"ï¼å 为elasticsearchSink端并没æç¼ç é ç½®ãæä»¥æå¨ä¸ªäººä½¿ç¨ä¸å°execSource.javaä½åºä»¥ä¸ä¿®æ¹ï¼ eventList.add(EventBuilder.withBody(line.getBytes("UTF-8"))); You can merge this pull request into a Git repository by running: $ git pull https://github.com/xvjie/flume trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flume/pull/201.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #201 ---- commit 9308d65da83f21497802569c5e2ed02a8c1806ec Author: jie.xu <450172223@...> Date: 2018-03-13T01:42:53Z ãä¹±ç é®é¢ãexecSource I hope to confirm the following questions: When I use execSource to get data to elasticsearchSink: The source uses the "GBK" encoding, and the data on the es side will be garbled. I think: When the exec source configuration code is "GBK", the data should be encoded as "UTF-8" after reading the data, because the elasticsearchSink side does not have a code configuration. So I made the following changes to execSource.java in my personal use: eventList.add(EventBuilder.withBody(line.getBytes("UTF-8"))); --------------------------------------------------------------------------------------------è±æè¡¨è¾¾ä¸æ¸ æ¥çè¯ï¼ä»¥ä¸æ¯æ±è¯åæ æå¨ä½¿ç¨execSourceè·åæ°æ®å°elasticsearchSinkæ¶ï¼ source使ç¨âGBKâç¼ç ï¼esç«¯çæ°æ®ä¼ä¹±ç ã æè®¤ä¸ºï¼ execæºç«¯é ç½®ç¼ç 为âGBKâæ¶ï¼å¨è¯»åå°æ°æ®ä»¥ååºè¯¥å°æ°æ®ç¼ç 为"UTF-8"ï¼å 为elasticsearchSink端并没æç¼ç é ç½®ãæä»¥æå¨ä¸ªäººä½¿ç¨ä¸å°execSource.javaä½åºä»¥ä¸ä¿®æ¹ï¼ eventList.add(EventBuilder.withBody(line.getBytes("UTF-8"))); ---- ---