Skip to content

Commit

Permalink
Elastic.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed Sep 5, 2024
1 parent ba9bb8e commit 97d85b7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Diagnostics/ElasticSearch.Logging/.universal/logging.ps1
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 Diagnostics/ElasticSearch.Logging/ElasticSearch.Logging.psd1
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'
}
}
}

11 changes: 11 additions & 0 deletions Diagnostics/ElasticSearch.Logging/README.md
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)
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Contains scripts and widgets that are specific to Active Directory.

Contains full apps that can be run with PowerShell Universal.

### [Diagnostics](/Diagnostics)

Diagnostic tools for PowerShell Universal.

### [Graph](/Graph)

Contains scripts that interact with the Microsoft Graph.
Expand Down
Binary file added images/Logging/ElasticSearch.Logging.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 97d85b7

Please sign in to comment.