Splunk® Enterprise

Search Manual

Download manual as PDF

Splunk Enterprise version 5.0 reached its End of Life on December 1, 2017. Please see the migration information.
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Download topic as PDF

Externalized Search Error Strings

Externalized search errors

All externalized strings in Splunk, including error strings for search commands, are defined in the literals.conf configuration file. A Splunk user and administrator should not need to edit this file; however, a Splunk developer may wish to overwrite existing strings or define custom configurations.

The configuration file is located in $SPLUNK_HOME/etc/system/default/literals.conf. DO NOT edit this file. Read the rest of this topic before proceeding.

Search error strings

The part of the file dedicated to search error strings is indicated with:

# String externalization starts here

This is followed with a stanza for each search command that has error strings associated with it. For example, the eval command's stanza reads:

[EVAL]
MISSING_ARGS		= Missing arguments. usage: eval dest_key = expression
FAILED_PARSE		= Failed to parse arguments. eval usage: eval dest_key = expression
INVALID_DEST		= Invalid destination key
BOOLEAN_RESULT		= The result of an expression cannot be boolean. Try if([bool expr], [expr], [expr])
BAD_DEST_BRACKETS	= Invalid destination field. {} brackets must be closed
INVALID_OP__S		= Invalid operator at '%s'
TYPE_FAIL_CONCAT	= Typechecking failed. '.' operator only takes strings and numbers
TYPE_FAIL_DIFF__S	= Typechecking failed. '%s' operator received different types
TYPE_FAIL_PLUS		= Typechecking failed. '+' only takes two strings or two numbers
TYPE_FAIL_NUM__S	= Typechecking failed. '%s' only takes numbers
TYPE_FAIL_BOOL__S	= Typechecking failed. '%s' only takes boolean arguments
MATCH_FAIL__C		= Malformed expression - %c expected
CONSUME_FAIL__S		= Malformed expression - %s expected
INVALID_NUMBER__S	= Invalid number: %s
INVALID_UNARY_OP	= Malformed expression - Invalid unary op
UNEXPECTED_CHAR__C	= Malformed expression - Unexpected character hit in factor: %c
MISSING_FACTOR		= Malformed expression - Missing factor
MISSING_TERM		= Malformed expression - Missing term
MISSING_COMP_TERM	= Malformed expression - Missing comparison term
MISSING_AND		= Malformed expression - Missing AND term
MISSING_OR		= Malformed expression - Missing OR term
INVALID_FUNC_ARGS__S	= Invalid arguments to '%s' function
BAD_FUNC__S		= Unsupported Function: %s

Overwrite or define error strings

Before you edit literals.conf, refer to the configuration specification and example files:

  • $SPLUNK_HOME/etc/system/README/literals.conf.spec
  • $SPLUNK_HOME/etc/system/README/literals.conf.example

To overwrite existing error strings or define custom error strings, create a literals.conf in:

$SPLUNK_HOME/etc/system/local/

Overwrite an existing string by copying the stanza name and the attribute and value pair from the default literals.conf into the local literals.conf. Then, edit the value in the local copy literals.conf.

Define all new custom configurations in the local copy of literals.conf.

Important: Editing literals.conf incorrectly can seriously impact Splunk's performance. The following are guidelines for any changes you make to configurations in literals.conf:

  • Externalized strings are defined with attribute name and value pairs. You should only need to edit the attribute values. DO NOT edit the attribute names.
  • When strings contain "%s", DO NOT add or remove instances of %s or reorder their positions.
  • When strings contain HTML tags and entities, make sure all are properly escaped.
PREVIOUS
Custom search command example
  NEXT
What's in this chapter?

This documentation applies to the following versions of Splunk® Enterprise: 5.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 5.0.8, 5.0.9, 5.0.10, 5.0.11, 5.0.12, 5.0.13, 5.0.14, 5.0.15, 5.0.16, 5.0.17, 5.0.18, 6.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.14, 6.0.15, 6.1, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.1.5, 6.1.6, 6.1.7, 6.1.8, 6.1.9, 6.1.10, 6.1.11, 6.1.12, 6.1.13, 6.1.14


Was this documentation topic helpful?

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.

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