Hi Sophie, Thanks for getting back to me. Excuse the delay in responding. The documents are from the Elastic Engineer on demand training lab 4.3. Below are documents from the web_traffic index and its mappings. Also the transform config.
GET web_traffic/_search
{ "size": 2 }
{
"took" : 12,
"timed_out" : false,
"_shards" : {
"total" : 10,
"successful" : 10,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 10000,
"relation" : "gte"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "web_traffic",
"_type" : "_doc",
"_id" : "YC8lwnwBZfkXtLD3j3Jv",
"_score" : 1.0,
"_source" : {
"user_Agent" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36",
"request" : "/blog/find-strings-within-strings-faster-with-the-new-elasticsearch-wildcard-field",
"content_type" : "text/html; charset=utf-8",
"is_https" : true,
"response" : 200,
"verb" : "GET",
"geoip_location_lon" : -0.0961,
"@timestamp" : "2021-04-21T13:46:30.000Z",
"bytes_sent" : 40322,
"geoip_location_lat" : 51.5132,
"runtime_ms" : 390558
}
},
{
"_index" : "web_traffic",
"_type" : "_doc",
"_id" : "bi8lwnwBZfkXtLD3j3Jv",
"_score" : 1.0,
"_source" : {
"user_Agent" : "got (https://github.com/sindresorhus/got)",
"request" : "/blog/this-week-in-elasticsearch-and-apache-lucene-2017-12-18",
"content_type" : "text/html; charset=utf-8",
"is_https" : true,
"response" : 200,
"verb" : "GET",
"geoip_location_lon" : -77.2481,
"@timestamp" : "2021-04-16T06:06:57.000Z",
"bytes_sent" : 25122,
"geoip_location_lat" : 38.6583,
"runtime_ms" : 304112
}
}
]
}
}
GET web_traffic/_mapping
{
"web_traffic" : {
"mappings" : {
"properties" : {
"@timestamp" : {
"type" : "date"
},
"bytes_sent" : {
"type" : "long"
},
"content_type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"geo" : {
"properties" : {
"location" : {
"type" : "geo_point"
}
}
},
"geoip_location_lat" : {
"type" : "float"
},
"geoip_location_lon" : {
"type" : "float"
},
"http" : {
"properties" : {
"request" : {
"properties" : {
"method" : {
"type" : "keyword"
}
}
},
"response" : {
"properties" : {
"status_code" : {
"type" : "keyword"
}
}
}
}
},
"is_https" : {
"type" : "boolean"
},
"request" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"response" : {
"type" : "long"
},
"runtime_ms" : {
"type" : "long"
},
"url" : {
"properties" : {
"original" : {
"type" : "keyword",
"fields" : {
"text" : {
"type" : "text"
}
}
}
}
},
"user_Agent" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"user_agent" : {
"properties" : {
"device" : {
"properties" : {
"name" : {
"type" : "keyword"
}
}
},
"name" : {
"type" : "keyword"
},
"original" : {
"type" : "keyword",
"fields" : {
"text" : {
"type" : "text"
}
}
},
"version" : {
"type" : "keyword"
}
}
},
"verb" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
GET _transform/traffic_stats
{
"count" : 1,
"transforms" : [
{
"id" : "traffic_stats",
"version" : "7.13.1",
"create_time" : 1635420306615,
"source" : {
"index" : [
"web_traffic"
],
"query" : {
"match_all" : { }
}
},
"dest" : {
"index" : "traffic_stats"
},
"frequency" : "1m",
"pivot" : {
"group_by" : {
"url.original" : {
"terms" : {
"field" : "url.original"
}
}
},
"aggregations" : {
"@timestamp.value_count" : {
"value_count" : {
"field" : "@timestamp"
}
},
"runtime_ms.avg" : {
"avg" : {
"field" : "runtime_ms"
}
}
}
},
"settings" : {
"max_page_search_size" : 500
}
}
]
}