Troubleshooting: ANSI Escape Codes Trigger a Warning

Condition or Error

Web UI returns the error The output contained ANSI escape codes, which have been replaced due to security concerns

ANSI escape characters are replaced with another character. For example, \u001b are replaced with \ufffd

Causes

  • Since LogScale v1.112.1, LogScale replaces ANSI escape characters found in query results to prevent potential security issues.

Solutions

  • There are two ways to address the problem:

    • Replace the ANSI characters in the results with a string or character that you choose. For example:

      logscale
      | replace("\\u001b", with=X)

      Would replace the ANSI escape character with X.

    • ANSI escaping of results is controlled by the ReplaceANSIEscapeCodes dynamic variable. Setting the dynamic configuration to false disables the escaping process.