Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOG-6073 Add default value for count search #128

Merged
merged 1 commit into from Mar 3, 2020
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

LOG-6073 Add default value for count search

  • Loading branch information
jirka-kruml committed Mar 3, 2020
commit e05e97753a8745949f7683813b7859fe41293f5e
@@ -898,6 +898,12 @@ searchAndFetch() {
result=$(curl -s -u $LOGGLY_USERNAME:$LOGGLY_PASSWORD $url)
count=$(echo "$result" | grep total_events | awk '{print $2}')
count="${count%\,}"

# If no result is fetched, return 0
isNumberRegex='^[0-9]+$'
if ! [[ $count =~ $isNumberRegex ]] ; then
count=0
fi
eval $1="'$count'"
if [ "$count" -gt 0 ]; then
timestamp=$(echo "$result" | grep timestamp)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.