Skip to content

Instantly share code, notes, and snippets.

@chrisronline
Created January 5, 2021 15:09
Show Gist options
  • Save chrisronline/2191a43d0ea26c0330748202175b960e to your computer and use it in GitHub Desktop.
Save chrisronline/2191a43d0ea26c0330748202175b960e to your computer and use it in GitHub Desktop.
es_version_mismatch
# ES VERSION MISMATCH
PUT _ingest/pipeline/es_change_versions
{
"processors": [
{
"script": {
"lang": "painless",
"source": """
if (ctx.type == "cluster_stats") {
String[] versions = new String[] { "7.0.0", "7.1.0", "7.2.0" };
ctx.cluster_stats.nodes.versions = versions;
}
"""
}
}
]
}
# Ensure a local exporter is explictly configured so the default pipeline is established
PUT _cluster/settings
{
"transient": {
"xpack.monitoring.exporters": {
"local": {
"type": "local",
"use_ingest": false
}
}
}
}
# Use the created pipeline
PUT .monitoring-es-7-*/_settings
{
"index.default_pipeline": "es_change_versions"
}
# This will unset the pipeline (and therefore resolve the alert)
PUT .monitoring-es-7-*/_settings
{
"index.default_pipeline": null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment