Created
March 20, 2021 17:15
Star
You must be signed in to star a gist
Get a simplistic view of an ElasticSearch template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ES="192.168.0.2:9200" | |
INDEX="stats-000001" | |
curl -s -XGET "http://$ES/$INDEX/_mapping " |\ | |
jq -r --arg INDEX "$INDEX" '.[$INDEX].mappings.properties | | |
[leaf_paths as $path | | |
{"key": $path | join("."), "value": getpath($path)}] | | |
from_entries' |\ | |
grep -v fields |\ | |
sed -e 's/.type": "/: "/' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@timestamp: "date", | |
"avg_doc_size: "float", | |
"daily_size: "float", | |
"doc_count: "long", | |
"index: "text", | |
"name: "text", | |
"query_count: "long", | |
"size_in_bytes: "long", | |
"tags: "text", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment