Insert & Delete Data - Steps
Steps to delete the records:
Refer to the sample below to delete the data for the month of July module-wise in the Postgres database:
delete from nss_ingest_data where dataKey like '%-07-2022:FIRE%';
delete from nss_ingest_data where dataKey like '%-07-2022:TL%';
delete from nss_ingest_data where dataKey like '%-07-2022:WS%';
delete from nss_ingest_data where dataKey like '%-07-2022:PGR%';
delete from nss_ingest_data where dataKey like '%-07-2022:PT%';
delete from nss_ingest_data where dataKey like '%-07-2022:MCOLLECT%';
Steps to delete the records from ES:
Adjust the module and the date range accordingly.
Check the records before deleting.
GET firenoc-national-dashboard/_search
{
"query": {
"bool": {
"must": [
{
"range": {
"date": {
"gte": 1656613800000,
"lte": 1658773799000,
"format": "epoch_millis"
}
}
}
]
}
}
}
POST firenoc-national-dashboard/_delete_by_query
{
"query": {
"bool": {
"must": [
{
"range": {
"date": {
"gte": 1656613800000,
"lte": 1658773799000,
"format": "epoch_millis"
}
}
}
]
}
}
}
Last updated
Was this helpful?