Cleaning out too big

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search

The following sql commands will clean out data that has been ingested but too big for reporting bigint

delete from summarytrafficgroups  where firstseen>gettimeimmutable('7 day') and srcbytes> 1000000000000 or dstbytes>1000000000000;
delete from summarytraffic where firstseen>gettimeimmutable('7 day') and bytes>1000000000000;
delete from interfacestats where firstseen>gettimeimmutable('7 day') and bpsin>1000000000000or bpsout>1000000000000;
delete from summaryinterfaces where firstseen>gettimeimmutable('7 day') and bytesin> 1000000000000 or bytesout>1000000000000;
delete from summarytrafficinterfacein where firstseen>gettimeimmutable('7 day') and bytes>1000000000000;
delete from summarytrafficinterfaceout where firstseen>gettimeimmutable('7 day') and bytes>1000000000000;


delete from summarytrafficgroups  where firstseen>gettimeimmutable('7 day') and srcbytes<0 or dstbytes<0;
delete from summarytraffic where firstseen>gettimeimmutable('7 day') and bytes<0;
delete from interfacestats where firstseen>gettimeimmutable('7 day') and bpsin<0 or bpsout<0;
delete from summaryinterfaces where firstseen>gettimeimmutable('7 day') and bytesin<0 or bytesout<0;
delete from summarytrafficinterfacein where firstseen>gettimeimmutable('7 day') and bytes<0;
delete from summarytrafficinterfaceout where firstseen>gettimeimmutable('7 day') and bytes<0;