Skip to content

Commit

Permalink
http_logs: set the date formatter for @timestamp (#390)
Browse files Browse the repository at this point in the history
* Revert "Revert "http_logs: use suitable date formater for @timestamp (#388)" (#389)"

This reverts commit b1479ad.

* Use ISO 8601 date format when ingest_pipeline==grok
  • Loading branch information
inqueue authored Apr 10, 2023
1 parent b1479ad commit 11c5d6c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion http_logs/index-runtime-fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"properties": {
"@timestamp": {
"format": "strict_date_optional_time||epoch_second",
"format": "strict_date_optional_time",
"type": "date"
},
"message": {
Expand Down
6 changes: 5 additions & 1 deletion http_logs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
},
"properties": {
"@timestamp": {
"format": "strict_date_optional_time||epoch_second",
{%- if ingest_pipeline is defined and ingest_pipeline == "grok" %}
"format": "strict_date_optional_time",
{%- else %}
"format": "epoch_second",
{%- endif %}
"type": "date"
},
"message": {
Expand Down
12 changes: 6 additions & 6 deletions http_logs/operations/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
{
"range": {
"@timestamp": {
"gte": "1998-05-01T00:00:00Z",
"lt": "1998-05-02T00:00:00Z"
"gte": {{query_range_ts_start | tojson}},
"lt": {{query_range_ts_end | tojson}}
}
}
},
Expand Down Expand Up @@ -156,8 +156,8 @@
{
"range": {
"@timestamp": {
"gte": "1998-05-01T00:00:00Z",
"lt": "1998-05-02T00:00:00Z"
"gte": {{query_range_ts_start | tojson}},
"lt": {{query_range_ts_end | tojson}}
}
}
},
Expand Down Expand Up @@ -232,7 +232,7 @@
"sort" : [
{"@timestamp" : "desc"}
],
"search_after": ["1998-06-10"]
"search_after": [{{search_after_ts | tojson}}]
}
},
{
Expand Down Expand Up @@ -260,7 +260,7 @@
"sort" : [
{"@timestamp" : "asc"}
],
"search_after": ["1998-06-10"]
"search_after": [{{search_after_ts | tojson}}]
}
},
{
Expand Down
6 changes: 6 additions & 0 deletions http_logs/track.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@

{%- if runtime_fields is defined %}
{% set index_body = 'index-runtime-fields.json' %}
{% set query_range_ts_start = "1998-05-01T00:00:00Z" %}
{% set query_range_ts_end = "1998-05-02T00:00:00Z" %}
{% set search_after_ts = "1998-06-10" %}
{%- else %}
{% set index_body = 'index.json' %}
{% set query_range_ts_start = "893980800" %}
{% set query_range_ts_end = "894067200" %}
{% set search_after_ts = "897436800" %}
{%- endif %}
{
"version": 2,
Expand Down

0 comments on commit 11c5d6c

Please sign in to comment.