Small elasticsearch fixups
[freeradius.git] / doc / schemas / logstash / radius-mapping.sh
1 #! /bin/sh
2
3 # Create a template mapping for RADIUS data
4 # Matthew Newton
5 # April 2015
6
7 # This should be run on an elasticsearch node. Alternatively, adjust
8 # the curl URI below.
9
10 curl -XPUT '127.0.0.1:9200/_template/radius' -d '
11 {
12   "template":"radius-*",
13   "order":0,
14   "mappings":{
15     "detail":{
16       "dynamic_templates":[
17         { "keep_message":{
18             "match":"message",
19             "mapping":{
20               "type":"string",
21               "index":"analyzed"
22             }
23           }
24         },
25         { "no_analyze_strings":{
26             "match":"*",
27             "match_mapping_type":"string",
28             "mapping":{
29               "type":"string",
30               "index":"not_analyzed"
31             }
32           }
33         }
34       ]
35     }
36   }
37 }'
38