Skip to content

Instantly share code, notes, and snippets.

@secabstraction
Last active February 16, 2016 19:33
Show Gist options
  • Save secabstraction/da97bf406f0067ed6b67 to your computer and use it in GitHub Desktop.
Save secabstraction/da97bf406f0067ed6b67 to your computer and use it in GitHub Desktop.
$JSON = @'
{
"template": "powerstash-*",
"mappings": {
"eventlogentry": {
"properties" : {
"Id": { "type": "string" },
"TimeCreated" : { "type" : "date" },
"DateCreated" : { "type" : "date" },
"EventId" : { "type" : "integer" },
"ComputerName" : { "type" : "string" },
"Level" : { "type" : "string" },
"Provider" : { "type" : "string" },
"LogName" : { "type" : "string" },
"Category" : { "type" : "string" },
"Type" : { "type" : "string" },
"InsertionStrings" : { "type" : "string" },
"Message" : { "type" : "string" },
"User" : { "type" : "string" }
}
}
}
}
'@
$JSON = $JSON.Replace(' ','').Replace("`n",'')
Invoke-WebRequest -Method Put -Uri http://myelastic:9200/_template/powerstash -Body $JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment