Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$lastDay = ( get-date ).addDays( -1 ).toString( ‘s’ );
$lastHour = ( get-date ).addMinutes( -60 ).toString( ‘s’ );
$searches = @(
"ERROR"
, "source=""tutorialdata.zip:*"" ERROR"
, "CreditDoesNotMatch"
,"source=""tutorialdata.zip:.\\www3/access.log"" productId=WC-SH-G04"
)
Write-Output $lastDay
foreach($search in $searches)
{
$qry = $search + " | stats count"
Write-Output $qry
Search-Splunk -Search $qry -StartTime $lastDay | Select-Object -ExpandProperty Count
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.