PowerShell module for common maintenance tasks in ElasticSearch.
###Supported APIs
###Requirements
###Getting Started PowerShell modules can be loaded by either copying the PSM1 and PSD1 files into your $env:PSModulePath or by directly referencing the PSD1 module manifest when calling Import-Module. Once imported the command Get-EsIndexes becomes available for use in the shell instance. The command returns a PowerShell object containing NoteProperties of returned indicies and ScriptMethods that can be called against them.
###Command Syntax The command makes HTTP calls to the ElasticSearch server at the Server and Port you specify. By default ALL indexes present will be returned. The prefix will vary based on your use and needs, but in our case ElasticSearch is used to catalog LogStash data - so indexes look like "logstash-${YEAR}-${MONTH}-${DAY}.${HOUR}" (i.e. the IndexPrefix is "logstash").
Get-EsIndexes -Protocol <[http|https] [Default=http]> -Server <ES FQDN or IP Address [Default=localhost]> -Port <ES Port [Default=9200]> -IndexPrefix <ES Index Prefix [Default=.*]>
###Object Definitions
Name | MemberType | Definition |
---|---|---|
Equals | Method | bool Equals(System.Object obj) |
GetHashCode | Method | int GetHashCode() |
GetType | Method | type GetType() |
ToString | Method | string ToString() |
Age | NoteProperty | System.TimeSpan |
Index | NoteProperty | System.String |
Port | NoteProperty | System.Int32 |
Server | NoteProperty | System.String |
Status | NoteProperty | System.String |
ClearCache | ScriptMethod | System.Object ClearCache() |
CloseIndex | ScriptMethod | System.Object CloseIndex() |
Delete | ScriptMethod | System.Object Delete() |
Flush | ScriptMethod | System.Object Flush() |
OpenIndex | ScriptMethod | System.Object OpenIndex() |
Optimize | ScriptMethod | System.Object Optimize() |
Refresh | ScriptMethod | System.Object Refresh() |