Skip to content

Instantly share code, notes, and snippets.

@jerrac
Created February 18, 2016 00:46
Show Gist options
  • Select an option

  • Save jerrac/c6b2ade878a2e1ffe4c9 to your computer and use it in GitHub Desktop.

Select an option

Save jerrac/c6b2ade878a2e1ffe4c9 to your computer and use it in GitHub Desktop.

Revisions

  1. jerrac revised this gist Feb 18, 2016. No changes.
  2. jerrac created this gist Feb 18, 2016.
    181 changes: 181 additions & 0 deletions template.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,181 @@
    {
    "template" : "logstash-*",
    "settings" : {
    "index.refresh_interval" : "5s"
    },
    "mappings" : {
    "_default_" : {
    "_all" : {"enabled" : true, "omit_norms" : true},
    "dynamic_templates" : [ {
    "message_field" : {
    "match" : "message",
    "match_mapping_type" : "string",
    "mapping" : {
    "type" : "string", "index" : "analyzed", "omit_norms" : true,
    "fielddata" : { "format" : "disabled" }
    }
    }
    }, {
    "string_fields" : {
    "match" : "*",
    "match_mapping_type" : "string",
    "mapping" : {
    "type" : "string", "index" : "analyzed", "omit_norms" : true,
    "fielddata" : { "format" : "disabled" },
    "fields" : {
    "raw" : {"type": "string", "index" : "not_analyzed", "doc_values" : true, "ignore_above" : 256}
    }
    }
    }
    }, {
    "float_fields" : {
    "match" : "*",
    "match_mapping_type" : "float",
    "mapping" : { "type" : "float", "doc_values" : true }
    }
    }, {
    "double_fields" : {
    "match" : "*",
    "match_mapping_type" : "double",
    "mapping" : { "type" : "double", "doc_values" : true }
    }
    }, {
    "byte_fields" : {
    "match" : "*",
    "match_mapping_type" : "byte",
    "mapping" : { "type" : "byte", "doc_values" : true }
    }
    }, {
    "short_fields" : {
    "match" : "*",
    "match_mapping_type" : "short",
    "mapping" : { "type" : "short", "doc_values" : true }
    }
    }, {
    "integer_fields" : {
    "match" : "*",
    "match_mapping_type" : "integer",
    "mapping" : { "type" : "integer", "doc_values" : true }
    }
    }, {
    "long_fields" : {
    "match" : "*",
    "match_mapping_type" : "long",
    "mapping" : { "type" : "long", "doc_values" : true }
    }
    }, {
    "date_fields" : {
    "match" : "*",
    "match_mapping_type" : "date",
    "mapping" : { "type" : "date", "doc_values" : true }
    }
    }, {
    "geo_point_fields" : {
    "match" : "*",
    "match_mapping_type" : "geo_point",
    "mapping" : { "type" : "geo_point", "doc_values" : true }
    }
    },{"template1": {
    "mapping": {
    "doc_values": true,
    "ignore_above": 1024,
    "index": "not_analyzed",
    "type": "{dynamic_type}"
    },
    "match": "*"
    }
    } ],
    "properties" : {
    "@timestamp": { "type": "date", "doc_values" : true },
    "@version": { "type": "string", "index": "not_analyzed", "doc_values" : true },

    "cpu": {
    "properties": {
    "system_p": {
    "doc_values": "true",
    "type": "float"
    },
    "user_p": {
    "doc_values": "true",
    "type": "float"
    }
    }
    },
    "fs": {
    "properties": {
    "used_p": {
    "doc_values": "true",
    "type": "float"
    }
    }
    },
    "load": {
    "properties": {
    "load1": {
    "doc_values": "true",
    "type": "float"
    },
    "load15": {
    "doc_values": "true",
    "type": "float"
    },
    "load5": {
    "doc_values": "true",
    "type": "float"
    }
    }
    },
    "mem": {
    "properties": {
    "actual_used_p": {
    "doc_values": "true",
    "type": "float"
    },
    "used_p": {
    "doc_values": "true",
    "type": "float"
    }
    }
    },
    "proc": {
    "properties": {
    "cpu": {
    "properties": {
    "user_p": {
    "doc_values": "true",
    "type": "float"
    }
    }
    },
    "mem": {
    "properties": {
    "rss_p": {
    "doc_values": "true",
    "type": "float"
    }
    }
    }
    }
    },
    "swap": {
    "properties": {
    "used_p": {
    "doc_values": "true",
    "type": "float"
    }
    }
    },
    "geoip" : {
    "type" : "object",
    "dynamic": true,
    "properties" : {
    "ip": { "type": "ip", "doc_values" : true },
    "location" : { "type" : "geo_point", "doc_values" : true },
    "latitude" : { "type" : "float", "doc_values" : true },
    "longitude" : { "type" : "float", "doc_values" : true }
    }
    }
    }
    }
    }
    }