Last active
February 13, 2016 23:42
-
-
Save ashtewari/c29a8ac98587d42c91bd to your computer and use it in GitHub Desktop.
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
$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