Hello,
Started using transform but I am struggling to find how to look at only recent documents not from the beginning (because I have 1-year historical data)
The JSON of the job is:
{
"id": "ops_authrate_1m",
"authorization": {
"roles": [
"machine_learning_admin",
"kibana_admin",
"superuser",
"rollup_admin",
"Admin",
"monitoring_user",
"kibana_system",
"metricbeat_internal"
]
},
"version": "8.4.1",
"create_time": 1677688246676,
"source": {
"index": [
"opsrptlog-prod-*"
],
"query": {
"bool": {
"should": [
{
"match_phrase": {
"ops_event.transaction_type.keyword": "Card_Authorize"
}
}
],
"minimum_should_match": 1
}
}
},
"dest": {
"index": "prod-authrate-opsrpt"
},
"sync": {
"time": {
"field": "@timestamp",
"delay": "60s"
}
},
"pivot": {
"group_by": {
"ops_event.company_name": {
"terms": {
"field": "ops_event.company_name.keyword"
}
},
"@timestamp": {
"date_histogram": {
"field": "@timestamp",
"calendar_interval": "1m"
}
}
},
"aggregations": {
"total_events": {
"value_count": {
"field": "ops_event.status.keyword"
}
},
"processed": {
"filter": {
"term": {
"ops_event.status.keyword": "Processed"
}
},
"aggs": {
"all_processed": {
"value_count": {
"field": "ops_event.status.keyword"
}
}
}
},
"percentage": {
"bucket_script": {
"buckets_path": {
"success": "processed>all_processed",
"total": "total_events"
},
"script": "params.success / params.total * 100"
}
}
}
},
"settings": {
"docs_per_second": 20000
},
"retention_policy": {
"time": {
"field": "@timestamp",
"max_age": "32d"
}
}
}
I guess I am looking for some range which to specify looking for example last 1 day.
Thank you