Skip to content

Instantly share code, notes, and snippets.

@DamianStanger
Last active November 17, 2015 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DamianStanger/a7b15c961f98f086bea8 to your computer and use it in GitHub Desktop.
Save DamianStanger/a7b15c961f98f086bea8 to your computer and use it in GitHub Desktop.
@echo off
powershell "C:\Program` Files\Splunk\bin\scripts\SplunkSlackAlert.ps1 -ScriptName '%SPLUNK_ARG_0%' -NEvents '%SPLUNK_ARG_1%' -TriggerReason '%SPLUNK_ARG_5%' -BrowserUrl '%SPLUNK_ARG_6%' -ReportName '%SPLUNK_ARG_4%'"
param (
[string]$ScriptName = "No script specified",
[string]$NEvents = 0,
[string]$TriggerReason = "No reason specified",
[string]$BrowserUrl = "https://localhost:8000/",
[string]$ReportName = "No name of report specified"
)
$body = @{
text = "Test for a parameterized script `"$ScriptName`" `r`n This script retuned $NEvents and was triggered because $TriggerReason `r`n The Url to Splunk is $BrowserUrl `r`n The Report Name is $ReportName"
}
#Invoke-RestMethod -Uri https://hooks.slack.com/services/AAAAAAAAA/BBBBBBBBB/CCCCCCCCC -Method Post -Body (ConvertTo-Json $body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment