Skip to content

Instantly share code, notes, and snippets.

@nukemberg
Created April 7, 2016 23:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nukemberg/8b2817f611c6a9043889c88a61cdbc34 to your computer and use it in GitHub Desktop.
Save nukemberg/8b2817f611c6a9043889c88a61cdbc34 to your computer and use it in GitHub Desktop.
Elasticsearch index template for ELK based facter/puppet inventory
{
"template": "inventory",
"mappings": {
"host": {
"_source": {
"enabled": true,
"excludes" : ["network.interfaces.*.arp", "kernel.pnp_drivers", "kernel.modules"]
},
"dynamic_templates": [
{
"kernel_modules": {
"path_match": "kernel.modules",
"mapping": {
"include_in_all": false,
"enabled": false,
"dynamic": false,
"index": "no",
"store": false
}
}
},
{
"pnp_drivers": {
"path_match": "kernel.pnp_drivers",
"mapping": {
"include_in_all": false,
"enabled": false,
"dynamic": false,
"index": "no",
"store": false
}
}
},
{
"address_entries": {
"path_match": "network.interfaces.*.addresses",
"mapping": {
"include_in_all": false,
"enabled": false,
"dynamic": false,
"index": "no",
"store": false
}
}
},
{
"arp_entries": {
"path_match": "network.interfaces.*.arp",
"mapping": {
"include_in_all": false,
"enabled": false,
"dynamic": false,
"index": "no",
"store": false
}
}
},
{
"routes": {
"path_match": "network.interfaces.*.routes",
"mapping": {
"type": "object",
"include_in_all": false,
"enabled": false,
"dynamic": false,
"index": "no",
"store": false
}
}
},
{
"generic_string": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "not_analyzed"
}
}
}
],
"properties": {
"ipaddress": {"type": "ip"},
"ip_addresses": {"type": "ip"},
"network": {
"type": "object",
"properties": {
"interfaces": {
"type": "object"
}
}
},
"cpu": {
"dynamic": false,
"type": "object",
"properties": {
"total": { "type": "long" },
"real": { "type": "long" }
}
},
"etc": {
"type": "object",
"properties": {
"passwd": {
"type": "object",
"enabled": false,
"dynamic": false,
"index": "no"
},
"group": {
"type": "object",
"enabled": false,
"dynamic": false,
"index": "no"
}
}
},
"dmi": {
"type": "object",
"properties": {
"processor": {
"properties": {
"type": "object",
"all_records": {
"enabled": false,
"dynamic": false,
"index": "no"
}
}
},
"system": {
"properties": {
"type": "object",
"all_records": {
"enabled": false,
"dynamic": false,
"index": "no"
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment