I'm using Powershell (via Cmder) along with curl
(GoW) to create an index template in elasticsearch.
Here's my curl:
curl -XPUT http://myAddress:9200/_template/logstash_per_iis -u user:password -d'
{
"template" : "logstash*",
"mappings" : {
"iis" : {
"properties" : {
"response":{"type":"int"},
"site":{"type":"ip"},
"supresponse":{"type":"int"},
"time_taken":{"type":"int"},
"clientHost":{"type":"ip"},
"port":{"type":"int"},
"scstatus":{"type":"int"}
}
}
}
}
'
Here's the response from ES:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "failed to parse template source"
}
],
"type": "illegal_argument_exception",
"reason": "failed to parse template source",
"caused_by": {
"type": "json_parse_exception",
"reason": "Unrecognized token 'logstash': was expecting ('true', 'false' or 'null')\n at [Source: [B@38a6a400; line: 3, column: 25]"
}
},
"status": 400
}
ES is stating a json_parse_exception
, however, I cannot figure out where my JSON package is invalid.
What is wrong with my JSON or am I doing something else incorrectly?