Configure character set encoding

You can configure character set encoding for your data sources. Splunk software has built-in character set specifications to support internationalization of your deployment. Splunk software supports many languages (including some that do not use Universal Coded Character Set Transformation Format - 8-bit (UTF-8) encoding).

Splunk software attempts to apply UTF-8 encoding to your sources by default. If a source does not use UTF-8 encoding or is a non-ASCII file, Splunk software tries to convert data from the source to UTF-8 encoding unless you specify a character set to use by setting the CHARSET key in props.conf.

You can retrieve a list of the valid character encoding specifications by using the iconv -l command on most *nix systems. A port for iconv on Windows is available.

Supported character sets

Splunk software supports an extremely wide range of character sets, including such key ones as:

Here is a short list of the main supported character sets and the languages they correspond to.

Language

Code

Arabic

CP1256

Arabic

ISO-8859-6

Armenian

ARMSCII-8

Belarus

CP1251

Bulgarian

ISO-8859-5

Czech

ISO-8859-2

Georgian

Georgian-Academy

Greek

ISO-8859-7

Hebrew

ISO-8859-8

Japanese

EUC-JP

Japanese

SHIFT-JIS

Korean

EUC-KR

Russian

CP1251

Russian

ISO-8859-5

Russian

KOI8-R

Slovak

CP1250

Slovenian

ISO-8859-2

Thai

TIS-620

Ukrainian

KOI8-U

Vietnamese

VISCII

Manually specify a character set

To manually specify a character set to apply to an input, set the CHARSET key in props.conf:

[spec]
CHARSET=<string>

For example, if you have a host that generates data in Greek (called "GreekSource" in this example) and that uses ISO-8859-7 encoding, set CHARSET=ISO-8859-7 for that host in props.conf:

[host::GreekSource]
CHARSET=ISO-8859-7

Note: Splunk software parses only character encodings that have UTF-8 mappings. Some EUC-JP characters do not have a mapped UTF-8 encoding.

Automatically specify a character set

Splunk software can automatically detect languages and proper character sets using its sophisticated character set encoding algorithm.

To configure Splunk software to automatically detect the proper language and character set encoding for a particular input, set CHARSET=AUTO for the input in props.conf. For example, to automatically detect character set encoding for the host "my-foreign-docs", set CHARSET=AUTO for that host in props.conf:

[host::my-foreign-docs]
CHARSET=AUTO

Train Splunk software to recognize a character set

If you want to use a character set encoding that Splunk software does not recognize, train it to recognize the character set by adding a sample file to the following path and restarting Splunk Enterprise:

$SPLUNK_HOME/etc/ngram-models/_<language>-<encoding>.txt

For example, if you want to use the "vulcan-ISO-12345" character set, copy the specification file to the following path:

/SPLUNK_HOME/etc/ngram-models/_vulcan-ISO-12345.txt

After the sample file is added to the specified path, Splunk software recognizes sources that use the new character set, and automatically converts them to UTF-8 format at index time.

If you have Splunk Cloud and want to add a character set encoding to your Splunk deployment, file a Support ticket.

Comprehensive list of supported character sets

The common character sets described earlier are a small subset of what the CHARSET attribute can support. Splunk software also supports a long list of character sets and aliases, identical to the list supported by the *nix iconv utility.

Note: Splunk software ignores punctuation and case when matching CHARSET, so, for example, "utf-8", "UTF-8", and "utf8" are all considered identical.

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

Feedback submitted, thanks!

You must be logged into splunk.com in order to post comments.
Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic.
If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk,
consider posting a question to Splunkbase Answers.

0
out of 1000 Characters

Your Comment Has Been Posted Above

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website.
Learn more (including how to update your settings) here »