mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-19 15:33:06 +01:00
create so_short_term rp as default so that autogen can just be dropped once data is downsampled
This commit is contained in:
@@ -24,16 +24,16 @@ if [[ "$yorn" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
|||||||
day=0
|
day=0
|
||||||
startdate=`date`
|
startdate=`date`
|
||||||
|
|
||||||
while docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"SELECT mean(*) INTO \"so_long_term\".:MEASUREMENT FROM /.*/ WHERE \"time\" >= '2020-07-21T00:00:00.0000000Z' + ${day}d AND \"time\" <= '2020-07-21T00:00:00.0000000Z' + $((day+1))d GROUP BY time(5m),*\""; do
|
while docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"SELECT mean(*) INTO \"so_long_term\".:MEASUREMENT FROM \"autogen\"./.*/ WHERE \"time\" >= '2020-07-21T00:00:00.0000000Z' + ${day}d AND \"time\" <= '2020-07-21T00:00:00.0000000Z' + $((day+1))d GROUP BY time(5m),*\""; do
|
||||||
# why 2020-07-21?
|
# why 2020-07-21?
|
||||||
echo "Migration of 2020-07-21T00:00:00.0000000Z' + ${day}d started at $startdate and completed at `date`."
|
echo "Migration of 2020-07-21T00:00:00.0000000Z' + ${day}d started at $startdate and completed at `date`."
|
||||||
|
|
||||||
echo "Started cleaning 2020-07-21T00:00:00.0000000Z' + ${day}d at `date`"
|
# echo "Started cleaning 2020-07-21T00:00:00.0000000Z' + ${day}d at `date`"
|
||||||
if docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"DELETE FROM /.*/ WHERE \"time\" >= '2020-07-21T00:00:00.0000000Z' + ${day}d AND \"time\" <= '2020-07-21T00:00:00.0000000Z' + $((day+1))d\""; then
|
# if docker exec -t so-influxdb /bin/bash -c "influx -ssl -unsafeSsl -database telegraf -execute \"DELETE FROM /.*/ WHERE \"time\" >= '2020-07-21T00:00:00.0000000Z' + ${day}d AND \"time\" <= '2020-07-21T00:00:00.0000000Z' + $((day+1))d\""; then
|
||||||
echo -e "Completed cleaning 2020-07-21T00:00:00.0000000Z' + ${day}d at `date`\n"
|
# echo -e "Completed cleaning 2020-07-21T00:00:00.0000000Z' + ${day}d at `date`\n"
|
||||||
else
|
# else
|
||||||
echo -e "\nSomething went wrong with cleaning InfluxDB. Please verify that the so-influxdb Docker container is running, and check the log at /opt/so/log/influxdb/influxdb.log for any details."
|
# echo -e "\nSomething went wrong with cleaning InfluxDB. Please verify that the so-influxdb Docker container is running, and check the log at /opt/so/log/influxdb/influxdb.log for any details."
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
((day=day+1))
|
((day=day+1))
|
||||||
startdate=`date`
|
startdate=`date`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
influxdb:
|
influxdb:
|
||||||
retention_policies:
|
retention_policies:
|
||||||
autogen:
|
so_short_term:
|
||||||
default: True
|
default: True
|
||||||
duration: 30d
|
duration: 30d
|
||||||
shard_duration: 1d
|
shard_duration: 1d
|
||||||
|
|||||||
Reference in New Issue
Block a user