I am using "-" (dash) in order to separate the items. But, our customer tells us that the separator should be "alt0173" which leads to "-". How can i use "alt0173" instead of direct "-" in my script so that convert to dash in output txt?
Any advise will be so appreciated.
Regards
Unfortunately Logstash (still) doesn't have a mechanism for expressing Unicode escape sequences in its configuration, but the configuration file is meant to be UTF-8, so you can (as you've experienced) put literal Unicode characters into it.
Many thanks for your reply,
I used alt0173 in csv output fields and when open the output on my PC with Notepad++ it works fine and can find alt0173 (-). But when i open this file on another PC, it cannot find alt0173. Any advise will be so appreciated.
when i delete Â, starting logstash face with following error:
`> [ERROR][logstash.agent ] An exception happened when converging configuration
{:exception=>RuntimeError, :message=>"Could not fetch the configuration, message: The
following config files contains non-ascii characters but are not UTF-8 encoded
[\"F:/ELK_Windows/logstash-6.6.0/logstash-6.6.0/bin/OB13.conf\"]", :backtrace=>["F:/ELK_Windows/logstash-6.6.0/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:157:in `converge_state_and_update'", "F:/ELK_Windows/logstash-6.6.0/logstash-6.6.0/logstash-core/lib/logstash/agent.rb:101:in `execute'", "F:/ELK_Windows/logstash-6.6.0/logstash-6.6.0/logstash-core/lib/logstash/runner.rb:362:in `block in execute'", "F:/ELK_Windows/logstash-6.6.0/logstash-6.6.0/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}`
That's to be expected; the configuration file is expected to be in UTF-8. Nothing else will do. Logstash can process other encodings, but its configuration file must be UTF-8.
On Windows, you can use the Character Map application (if you can't type the character yourself). You'll want a Unicode font, such as Arial, tick the Advanced box, and in the 'Go to Unicode' box, enter 00AD. You'll find two things:
Unicode calls this character 'Soft Hyphen'
It also shows the Windows Alt-Keypad keystroke sequence (Alt+0173)
You can click on the Select the character for the 'Characters to copy' if you want to just copy it into your logstash configuration.
Many thanks for your reply. I type alt0173 for output field in the logstash config as fields separator, but the problem is in the output txt. txt file separator has been shown as "Â-" instead of "-". my config file is creating a txt file daily which includes some data separated using alt0173. customer is using ANSI encoding and they are seeing output separator as "Â-" instead of "-". how can i handle this issue so that output txt file separator automatically shows alt0173 (-) instead of (Â-).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.