{
	"script": {
		"lang": "mustache",
		"source": {
			"_source": {
				"excludes": []
			},
			"stored_fields": [
				"*"
			],
			"script_fields": {},
			"docvalue_fields": [
				{
					"field": "@timestamp",
					"format": "date_time"
				},
				{
					"field": "timestamp",
					"format": "date_time"
				}
			],
			"query": {
				"bool": {
					"must": [
						{
							"match_all": {}
						},
						{
							"match_phrase": {
								"network_id": {
									"query": "{{network_id_query_param}}"
								}
							}
						},
						{
							"range": {
								"@timestamp": {
									"gte": "{{timestamp_greater_than_equal_query_param}}",
									"lte": "{{timestamp_lesser_than_equal_query_param}}",
									"format": "yyyy-MM-dd"
								}
							}
						}
					],
					"filter": [],
					"should": [],
					"must_not": [
						{
							"match_phrase": {
								"max": 88888888888
							}
						}
					]
				}
			},
			"aggs": {
				"time_buckets": {
					"date_histogram": {
						"field": "@timestamp",
						"interval": "{{timestamp_interval_query_param}}",
						"time_zone": "{{timezone_query_param}}",
						"min_doc_count": 1
					},
					"aggs": {
						"routers": {
							"terms": {
								"field": "router_id.keyword",
								"order": {
									"_key": "desc"
								}
							},
							"aggs": {
								"avg_of": {
									"avg": {
										"field": "{{latency_filter_type_query_param}}"
									}
								}
							}
						}
					}
				}
			},
			"size": "{{size_query_param}}"
		}
	}
}