Last active
February 25, 2019 13:37
-
-
Save foospidy/576dd824cb2f1026b9515a0969b11d6f to your computer and use it in GitHub Desktop.
Expire all flagged IP events in Signal Sciences.
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
#!/usr/bin/env bash | |
################### | |
# Signal Sciences helper script: | |
# sigsci-expire-all-events.sh | |
# For a given site, the script will expire all flagged ip events. | |
# Requires: | |
# - pysigsci (https://pypi.org/project/pysigsci/) | |
# - jq (https://stedolan.github.io/jq/) | |
if [ -z $1 ]; | |
then | |
echo "usage: ./sigsci-expire-all-events.sh <site_name>" | |
exit; | |
fi | |
for identifier in `pysigsci --get events --status active --limit 1000 --site ${1} | jq ".data[] | .id"`; | |
do | |
id=`echo ${identifier} | tr '"' '\ '` | |
pysigsci --expire-event --site ${1} --id ${id} | jq '.id + " expires " + .expires' | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment