Skip to content

mustache

GitHub stars GitHub release (latest SemVer) GitHub last commit GitHub commit activity GitHub contributors

Community plugin: Plugins are maintained by their community authors, not by the MegaLinter team. Using a plugin means trusting its author. This plugin is maintained by Yann Jouanique: report its problems on its repository, not to MegaLinter.

Plugin to validate Logstash pipeline definition files using mustache

⚠️ Required items are missing in this plugin (native mode, SARIF output): see MegaLinter checks.

'mustache' is a Logstash configuration file parser that will check for valid syntax

mustache documentation

logstash-config - GitHub

Configuration in MegaLinter

Variable Description Default value
LOGSTASH_MUSTACHE_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
LOGSTASH_MUSTACHE_COMMAND_REMOVE_ARGUMENTS User custom arguments to remove from command line before calling the linter
Ex: -s --foo "bar"
LOGSTASH_MUSTACHE_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src\|lib)
Exclude no file
LOGSTASH_MUSTACHE_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test\|examples)
Exclude no file
LOGSTASH_MUSTACHE_CLI_LINT_MODE Override default CLI lint mode
- file: Calls the linter for each file
list_of_files
LOGSTASH_MUSTACHE_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
[".conf"]
LOGSTASH_MUSTACHE_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
LOGSTASH_MUSTACHE_PRE_COMMANDS List of bash commands to run before the linter None
LOGSTASH_MUSTACHE_POST_COMMANDS List of bash commands to run after the linter None
LOGSTASH_MUSTACHE_UNSECURED_ENV_VARIABLES List of env variables explicitly not filtered before calling LOGSTASH_MUSTACHE and its pre/post commands None
LOGSTASH_MUSTACHE_DISABLE_ERRORS Run linter but consider errors as warnings false
LOGSTASH_MUSTACHE_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0
LOGSTASH_MUSTACHE_TIMEOUT_SECONDS Maximum duration in seconds of the linter run, after which the linter process and its child processes are killed and reported as an error (exit code 124). Overrides LINTER_TIMEOUT_SECONDS. 0 disables the timeout 300
LOGSTASH_MUSTACHE_CLI_EXECUTABLE Override CLI executable ['mustache']
LOGSTASH_DIRECTORY Directory containing LOGSTASH files (use any to always activate the linter) logstash

Use this plugin

Add the descriptor URL of the plugin to PLUGINS in .mega-linter.yml. MegaLinter installs the plugin when it starts, whatever the flavor:

PLUGINS:
  - https://raw.githubusercontent.com/one-acre-fund/mega-linter-plugin-logstash/main/mega-linter-plugin-logstash/logstash.megalinter-descriptor.yml

Behind the scenes

How are identified applicable files

  • Activated only if sub-directory logstash is found. (directory name can be overridden with LOGSTASH_DIRECTORY)
  • File extensions: .conf

How the linting is performed

  • mustache is called one time by identified file (file CLI lint mode)

Example calls

mustache check 01-web.conf

Installation in Docker

MegaLinter runs these commands when it loads the plugin (only RUN instructions):

RUN ML_THIRD_PARTY_DIR="/third-party/mustache" \\
    && MUSTACHE_VERSION=0.5.3 \\
    && mkdir -p ${ML_THIRD_PARTY_DIR} \\
    && wget -P ${ML_THIRD_PARTY_DIR} -q "https://github.com/breml/logstash-config/releases/download/v${MUSTACHE_VERSION}/mustache_${MUSTACHE_VERSION}_Linux_x86_64.tar.gz" \\
    && tar xf ${ML_THIRD_PARTY_DIR}/mustache_${MUSTACHE_VERSION}_Linux_x86_64.tar.gz --directory ${ML_THIRD_PARTY_DIR} \\
    && mv ${ML_THIRD_PARTY_DIR}/mustache /usr/local/bin \\
    && rm -rf ${ML_THIRD_PARTY_DIR}

Installation without Docker (native mode)

Native mode does not run plugins yet: this section shows what the plugin declares for native mode.

Not available: see the MegaLinter checks of the plugin.

MegaLinter checks

These results last changed on 2026-11-28, and MegaLinter checks the plugins every day. The checks only look at the descriptor of the plugin: they do not review the plugin, nor the tool it runs.

Check Result
Descriptor ⚠️ Incomplete
Native mode ❌ Not supported
SARIF output ❌
Native lock ⚠️ No lock shipped by the plugin author

Required

Missing required items:

  • native_install declared and valid for the 5 native platforms (LOGSTASH_MUSTACHE): Native mode (MegaLinter without Docker) can not install the linter. Declare native_install, listing each of linux/amd64, linux/arm64, darwin/amd64, darwin/arm64 and windows/amd64 in platforms or in unsupported (with a reason)
  • SARIF output (LOGSTASH_MUSTACHE): The findings are missing from SARIF reports (GitHub code scanning, SARIF viewers, coding agents). Set can_output_sarif: true with cli_sarif_args when the tool outputs SARIF, otherwise sarif_text_regex (one finding per line of text) or sarif_unified_diff: true (formatters printing a diff)

Missing recommended items:

  • Native lock shipped next to the descriptor (<name>.megalinter-native-lock.json), for verified native installs
  • Rules documentation URL (linter_rules_url) (LOGSTASH_MUSTACHE)
  • Configuration documentation URL (linter_rules_configuration_url) (LOGSTASH_MUSTACHE)
  • Inline disable documentation URL (linter_rules_inline_disable_url) (LOGSTASH_MUSTACHE)
  • Ignore file documentation URL (linter_rules_ignore_config_url) (LOGSTASH_MUSTACHE)
  • Speed (linter_speed, 1 to 5) (LOGSTASH_MUSTACHE)
  • Icon (linter_icon_png_url) (LOGSTASH_MUSTACHE)
  • IDE extensions (ide) (LOGSTASH_MUSTACHE)
  • Supported lint modes (supported_cli_lint_modes) (LOGSTASH_MUSTACHE)
  • Default configuration file (config_file_name) (LOGSTASH_MUSTACHE)
  • Test fixtures (test_folder) (LOGSTASH_MUSTACHE)

Plugin authors

The requirements and how to fix them are described in Create your own plugin.

Comments