Skip to content

Instantly share code, notes, and snippets.

@secabstraction
Last active February 16, 2016 19:33
Show Gist options
  • Select an option

  • Save secabstraction/da97bf406f0067ed6b67 to your computer and use it in GitHub Desktop.

Select an option

Save secabstraction/da97bf406f0067ed6b67 to your computer and use it in GitHub Desktop.

Revisions

  1. secabstraction revised this gist Feb 16, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion PowerStashIndexTemplate.ps1
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,6 @@ $JSON = @'
    }
    '@

    Invoke-WebRequest -Method Put -Uri http://myelastic:9200/_template/powerstash -Body $JSON.Replace(' ','').Replace("`n",'')
    $JSON = $JSON.Replace(' ','').Replace("`n",'')

    Invoke-WebRequest -Method Put -Uri http://myelastic:9200/_template/powerstash -Body $JSON
  2. secabstraction created this gist Feb 16, 2016.
    26 changes: 26 additions & 0 deletions PowerStashIndexTemplate.ps1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    $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" }
    }
    }
    }
    }
    '@

    Invoke-WebRequest -Method Put -Uri http://myelastic:9200/_template/powerstash -Body $JSON.Replace(' ','').Replace("`n",'')