Skip to content

Instantly share code, notes, and snippets.

@kuzaxak
Created June 8, 2024 17:46
Show Gist options
  • Save kuzaxak/a7579679c13f1d3e3019f4444e3d109b to your computer and use it in GitHub Desktop.
Save kuzaxak/a7579679c13f1d3e3019f4444e3d109b to your computer and use it in GitHub Desktop.
Examples of queries from Opensearch Dashboards
{
"sort": [
{
"time": {
"order": "desc",
"numeric_type": "date_nanos",
"unmapped_type": "boolean"
}
}
],
"size": 500,
"version": true,
"aggs": {
"2": {
"date_histogram": {
"field": "time",
"fixed_interval": "30s",
"time_zone": "Europe/Tallinn",
"min_doc_count": 1
}
}
},
"stored_fields": [
"*"
],
"script_fields": {},
"docvalue_fields": [
{
"field": "full.@timestamp",
"format": "strict_date_time"
},
{
"field": "full.T",
"format": "strict_date_time"
},
{
"field": "full.audit_id",
"format": "strict_date_time"
},
{
"field": "full.build_date",
"format": "strict_date_time"
},
{
"field": "full.query.bool.filter.match_phrase.time",
"format": "strict_date_time"
},
{
"field": "full.query.bool.filter.range.time.gte",
"format": "strict_date_time"
},
{
"field": "full.query.bool.filter.range.time.lte",
"format": "strict_date_time"
},
{
"field": "full.start_time",
"format": "strict_date_time"
},
{
"field": "full.time",
"format": "strict_date_time"
},
{
"field": "full.timestamp",
"format": "strict_date_time"
},
{
"field": "kubernetes.annotations.kubectl.kubernetes.io/restartedAt",
"format": "strict_date_time"
},
{
"field": "kubernetes.annotations.update.k8s.elastic.co/timestamp",
"format": "strict_date_time"
},
{
"field": "time",
"format": "strict_date_time"
}
],
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [],
"filter": [
{
"match_all": {}
},
{
"range": {
"time": {
"gte": "2024-06-08T17:21:55.054Z",
"lte": "2024-06-08T17:36:55.054Z",
"format": "strict_date_optional_time"
}
}
}
],
"should": [],
"must_not": []
}
},
"highlight": {
"pre_tags": [
"@opensearch-dashboards-highlighted-field@"
],
"post_tags": [
"@/opensearch-dashboards-highlighted-field@"
],
"fields": {
"*": {}
},
"fragment_size": 2147483647
}
}
{
"sort": [
{
"time": {
"order": "desc",
"numeric_type": "date_nanos",
"unmapped_type": "boolean"
}
}
],
"size": 500,
"version": true,
"aggs": {
"2": {
"date_histogram": {
"field": "time",
"calendar_interval": "1m",
"time_zone": "Europe/Tallinn",
"min_doc_count": 1
}
}
},
"stored_fields": [
"*"
],
"script_fields": {},
"docvalue_fields": [
{
"field": "full.@timestamp",
"format": "strict_date_time"
},
{
"field": "full.T",
"format": "strict_date_time"
},
{
"field": "full.audit_id",
"format": "strict_date_time"
},
{
"field": "full.build_date",
"format": "strict_date_time"
},
{
"field": "full.query.bool.filter.match_phrase.time",
"format": "strict_date_time"
},
{
"field": "full.query.bool.filter.range.time.gte",
"format": "strict_date_time"
},
{
"field": "full.query.bool.filter.range.time.lte",
"format": "strict_date_time"
},
{
"field": "full.start_time",
"format": "strict_date_time"
},
{
"field": "full.time",
"format": "strict_date_time"
},
{
"field": "full.timestamp",
"format": "strict_date_time"
},
{
"field": "kubernetes.annotations.kubectl.kubernetes.io/restartedAt",
"format": "strict_date_time"
},
{
"field": "kubernetes.annotations.update.k8s.elastic.co/timestamp",
"format": "strict_date_time"
},
{
"field": "time",
"format": "strict_date_time"
}
],
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [],
"filter": [
{
"match_all": {}
},
{
"exists": {
"field": "full.path"
}
},
{
"match_phrase": {
"kubernetes.namespace_name": "ingress-nginx"
}
},
{
"range": {
"time": {
"gte": "2024-06-08T16:45:26.271Z",
"lte": "2024-06-08T17:45:26.271Z",
"format": "strict_date_optional_time"
}
}
}
],
"should": [],
"must_not": [
{
"range": {
"full.response_code": {
"gte": 1,
"lt": 500
}
}
},
{
"match_phrase": {
"cluster": "support"
}
}
]
}
},
"highlight": {
"pre_tags": [
"@opensearch-dashboards-highlighted-field@"
],
"post_tags": [
"@/opensearch-dashboards-highlighted-field@"
],
"fields": {
"*": {}
},
"fragment_size": 2147483647
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment