-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba9bb8e
commit 97d85b7
Showing
5 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
if (-not $PSUElasticLoggingLevel) { | ||
$PSUElasticLoggingLevel = "Information" | ||
} | ||
|
||
if (-not $PSUElasticHostName) { | ||
throw "The PSUElasticHostName variable is not set. Please set this variable to the hostname of the ElasticSearch server." | ||
} | ||
|
||
if (-not $PSUElasticPort) { | ||
throw "The PSUElasticPort variable is not set. Please set this variable to the port of the ElasticSearch server." | ||
} | ||
|
||
New-PSULoggingTarget -Type "TCP" -Level $PSUElasticLoggingLevel -Properties @{ | ||
hostName = "tcp://$PSUElasticHostName" | ||
port = $PSUElasticPort | ||
} -Scope "User" | ||
|
||
New-PSULoggingTarget -Type "TCP" -Level $PSUElasticLoggingLevel -Properties @{ | ||
hostName = "tcp://$PSUElasticHostName" | ||
port = $PSUElasticPort | ||
} -Scope "System" |
17 changes: 17 additions & 0 deletions
17
Diagnostics/ElasticSearch.Logging/ElasticSearch.Logging.psd1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@{ | ||
ModuleVersion = '1.0.0' | ||
GUID = '3cbc7ee1-aa80-4925-93b5-4967e8a05bdd' | ||
Author = 'Ironman Software' | ||
CompanyName = 'Ironman Software' | ||
Copyright = '(c) Ironman Software. All rights reserved.' | ||
Description = 'Logging targets for Elasticsearch in PowerShell Universal.' | ||
PrivateData = @{ | ||
PSData = @{ | ||
Tags = @('app', 'logging', 'elasticsearch') | ||
LicenseUri = 'https://github.com/ironmansoftware/scripts/blob/main/LICENSE' | ||
ProjectUri = 'https://github.com/ironmansoftware/scripts/tree/main/Diagnostics/ElasticSearch.Logging' | ||
IconUri = 'https://raw.githubusercontent.com/ironmansoftware/scripts/main/images/script.png' | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Elasticsearch Logging Targets | ||
|
||
This package provides a logging target for the [Elasticsearch](https://www.elastic.co/products/elasticsearch) search engine. | ||
|
||
## Variables | ||
|
||
- `$PSUElasticLoggingLevel` - The minimum log level to send to Elasticsearch. Default is `Information`. | ||
- `$PSUElasticHostName` - The host name of the Elasticsearch server. Required. | ||
- `$PSUElasticPort` - The port of the Elasticsearch server. Required. | ||
|
||
![ElasticSearch Logging](https://raw.githubusercontent.com/ironmansoftware/scripts/main/images/Diagnostics/ElasticSearch.Logging/ElasticSearch.Logging.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.