diff --git a/.changelog/3039.changed.txt b/.changelog/3039.changed.txt new file mode 100644 index 0000000000..0ce21957d0 --- /dev/null +++ b/.changelog/3039.changed.txt @@ -0,0 +1 @@ +feat: use timestamp as message time if exists \ No newline at end of file diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 1251db957a..394ad15191 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -188,17 +188,26 @@ sumologic: default: name: logs config-name: endpoint-logs - ## Properties can be used to extend default settings, such as processing rules, fields etc - # properties: - # filters: - # - name: "Test Exclude Debug" - # filter_type: "Exclude" - # regexp: ".*DEBUG.*" + properties: + default_date_formats: + ## Ensures that timestamp key has precedence over timestamp auto discovery + - format: epoch + locator: '\"timestamp\":(\\d+)' + + # filters: + # - name: "Test Exclude Debug" + # filter_type: "Exclude" + # regexp: ".*DEBUG.*" events: default: name: events config-name: endpoint-events + properties: + default_date_formats: + ## Ensures that timestamp key has precedence over timestamp auto discovery + - format: epoch + locator: '\"timestamp\":(\\d+)' traces: default: name: traces diff --git a/tests/helm/testdata/goldenfile/terraform/all_fields.output.yaml b/tests/helm/testdata/goldenfile/terraform/all_fields.output.yaml index 97532b31fa..afcbb78437 100644 --- a/tests/helm/testdata/goldenfile/terraform/all_fields.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/all_fields.output.yaml @@ -468,11 +468,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml b/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml index 9b87aeb7c1..378ff2ff9e 100644 --- a/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/collector_fields.output.yaml @@ -469,11 +469,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/default.output.yaml b/tests/helm/testdata/goldenfile/terraform/default.output.yaml index c51a100983..1b374efb6e 100644 --- a/tests/helm/testdata/goldenfile/terraform/default.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/default.output.yaml @@ -467,11 +467,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml b/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml index 43aee706b5..12b5e577af 100644 --- a/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/disable_default_metrics.output.yaml @@ -466,11 +466,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml b/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml index e25996369b..df38465b68 100644 --- a/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/disabled_dashboards.output.yaml @@ -467,11 +467,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml b/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml index 024fd2de7d..6c6fafcac2 100644 --- a/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/disabled_monitors.output.yaml @@ -467,11 +467,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml b/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml index bf418ce71e..15f76ab1a9 100644 --- a/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/monitors_with_email_notifications.output.yaml @@ -473,11 +473,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml b/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml index e1155aa119..b64fbf1ec4 100644 --- a/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/monitors_with_single_email.output.yaml @@ -473,11 +473,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml b/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml index 3cd3aa1b69..38815fdf85 100644 --- a/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/strip_extrapolation.output.yaml @@ -468,11 +468,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" { diff --git a/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml b/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml index c51a100983..1b374efb6e 100644 --- a/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml +++ b/tests/helm/testdata/goldenfile/terraform/tracing-metrics-disabled.output.yaml @@ -467,11 +467,19 @@ data: resource "sumologic_http_source" "default_events_source" { name = local.default_events_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "default_logs_source" { name = local.default_logs_source collector_id = sumologic_collector.collector.id + default_date_formats { + format = "epoch" + locator = "\"timestamp\":(\\d+)" + } } resource "sumologic_http_source" "apiserver_metrics_source" {