-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logstash init.d script should source default locale set. #5048
Comments
@abcfy2 would you be able to contribute a pull request to fix this? That will be super helpful! |
Sure, and it's very simple. But which branch should I commit to? And which file should I modify? |
我遇到了同样的问题,请问下怎么解决呢,谢谢 |
You can check your locale setting via
If your locale contains I find that you submit an issue #5272, which is different from this. I followed your type, and it works very well.
I think you should check your locale setting first. |
thank you,but i change the file /etc/sysconfig/i18n with content LANG="zh_CN.UTF-8". bin/logstash -e 'input { stdin { } } output { stdout {} }' but the logstash 's output is still question-mark,i think there is some other place need to check, but i dont know where is it.. |
Strange. Check if your locale if support zh_CN.UTF-8:
If so. Try:
Then start logstash and try again. |
Very strange.. i give up, Thx very much |
@untergeek is making much needed changes to our release packages, so he'll incorporate locale settings. |
We're going to bypass this altogether by using a java options file called
The reason for not trying to solve the locale problem with environment variables is that this approach is completely cross-platform. It should work the same on any machine or environment. |
This is addressed in #5341 by having Java locale options set in |
First, let's look at a snippet of
tomcat7
init.d script in Ubuntu 14.04:Ubuntu store its locale set into
/etc/default/locale
, while RHEL/CentOS 6 store it into/etc/sysconfig/i18n
.This makes sense, as that if logstash isn't starting from a login shell, would display UTF-8 characters as
????
. Some program will considerLC_ALL=C
if run from a non-login environment. So this will cause the log cannot output the UTF8 characters.For example, I use
saltstack
to manage logstash service, which doesn't use login shell to manage service, and I find theemail
output will display????
.My config is like:
But I receive the email subject is
??? shifudao mongodb ???????, query??: 20233 ms
. When I restart the logstash service via login bash, it's OK.The text was updated successfully, but these errors were encountered: