[Stack Monitoring] Fix Recent Log Entries timezone#249016
Merged
jbudz merged 1 commit intoelastic:mainfrom Jan 14, 2026
Merged
Conversation
consulthys
approved these changes
Jan 14, 2026
Contributor
consulthys
left a comment
There was a problem hiding this comment.
LGT Stack Monitoring
Thank you very much for the changes 👍
kapral18
commented
Jan 14, 2026
| return useUTC | ||
| ? moment.utc(date).format('LL LTS') | ||
| : moment.tz(date, timezone || moment.tz.guess()).format('LL LTS'); | ||
| export function formatDateTimeLocal(date: number | Date, timezone?: string | null): string { |
Contributor
Author
There was a problem hiding this comment.
useUTC is removed because is no longer used anywhere
56ee6e1 to
f1615c4
Compare
mattkime
approved these changes
Jan 14, 2026
Contributor
mattkime
left a comment
There was a problem hiding this comment.
Code changes look good, work well!
…stamps - Resolve dateFormat:tz values of Browser/null/unset to the guessed timezone - Add unit tests to cover explicit, Browser, and default timezone behavior
f1615c4 to
fc96d61
Compare
Contributor
|
Starting backport for target branches: 8.19, 9.1, 9.2, 9.3 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 14, 2026
Closes elastic#120292 ## Summary The Stack Monitoring **Recent Log Entries** table now respects the Kibana `dateFormat:tz` advanced setting. ## Details - Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of `Browser`/`null`/unset as the browser-guessed timezone - Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as expected - Adds unit tests covering explicit timezone, `Browser`, and default/unset behavior ## Demo Current locale is UTC+1 (value should be 2:26) ### Before <img width="1718" height="1407" alt="SCR-20260114-myjp" src="https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868" /> ### After <img width="1720" height="1408" alt="SCR-20260114-mymj" src="https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378" /> ## Test plan - `node scripts/jest x-pack/platform/plugins/private/monitoring/common/formatting.test.ts` - Manual: change **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates ## Manual test data (optional) If you don't already have Stack Monitoring data available locally, you can create a minimal set of documents via **Kibana → Dev Tools → Console**. Pick values for: - `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z` - `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324` Then run: 1) Create a minimal cluster stats doc (note the `timestamp` field): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "timestamp": <EPOCH_MS>, "type": "cluster_stats", "metricset": { "name": "cluster_stats" }, "data_stream": { "type": "metrics", "dataset": "elasticsearch.stack_monitoring.cluster_stats", "namespace": "default" }, "cluster_uuid": "tz-test-cluster", "cluster_name": "tz-test-cluster", "license": { "status": "active", "type": "trial", "expiry_date_in_millis": 1894665600000 } } ``` 2) Create a minimal Elasticsearch server log doc for the same cluster: ```http POST logs-elasticsearch.server-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "message": "TZ regression test log entry - should show in browser timezone", "service": { "type": "elasticsearch" }, "event": { "dataset": "elasticsearch.server" }, "log": { "level": "INFO" }, "elasticsearch": { "cluster": { "uuid": "tz-test-cluster" }, "node": { "name": "test-node-1" }, "component": "test-component" } } ``` 3) In Kibana: - Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g. **Last 15 minutes** if you used “now - 5m”) - Go to **Stack Monitoring → Elasticsearch → Overview** and confirm **Recent Log Entries** shows the row - Flip **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** between `Browser` and `UTC` and confirm the displayed timestamp shifts accordingly 4) Cleanup (optional): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true { "query": { "term": { "cluster_uuid": "tz-test-cluster" } } } ``` ```http POST logs-elasticsearch.*-*/_delete_by_query?refresh=true { "query": { "term": { "elasticsearch.cluster.uuid": "tz-test-cluster" } } } ``` # Release Note Fix Stack Monitoring Recent Log Entries timestamps to respect Kibana's time zone setting (`dateFormat:tz`). (cherry picked from commit 67cefd4)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 14, 2026
Closes elastic#120292 ## Summary The Stack Monitoring **Recent Log Entries** table now respects the Kibana `dateFormat:tz` advanced setting. ## Details - Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of `Browser`/`null`/unset as the browser-guessed timezone - Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as expected - Adds unit tests covering explicit timezone, `Browser`, and default/unset behavior ## Demo Current locale is UTC+1 (value should be 2:26) ### Before <img width="1718" height="1407" alt="SCR-20260114-myjp" src="https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868" /> ### After <img width="1720" height="1408" alt="SCR-20260114-mymj" src="https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378" /> ## Test plan - `node scripts/jest x-pack/platform/plugins/private/monitoring/common/formatting.test.ts` - Manual: change **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates ## Manual test data (optional) If you don't already have Stack Monitoring data available locally, you can create a minimal set of documents via **Kibana → Dev Tools → Console**. Pick values for: - `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z` - `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324` Then run: 1) Create a minimal cluster stats doc (note the `timestamp` field): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "timestamp": <EPOCH_MS>, "type": "cluster_stats", "metricset": { "name": "cluster_stats" }, "data_stream": { "type": "metrics", "dataset": "elasticsearch.stack_monitoring.cluster_stats", "namespace": "default" }, "cluster_uuid": "tz-test-cluster", "cluster_name": "tz-test-cluster", "license": { "status": "active", "type": "trial", "expiry_date_in_millis": 1894665600000 } } ``` 2) Create a minimal Elasticsearch server log doc for the same cluster: ```http POST logs-elasticsearch.server-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "message": "TZ regression test log entry - should show in browser timezone", "service": { "type": "elasticsearch" }, "event": { "dataset": "elasticsearch.server" }, "log": { "level": "INFO" }, "elasticsearch": { "cluster": { "uuid": "tz-test-cluster" }, "node": { "name": "test-node-1" }, "component": "test-component" } } ``` 3) In Kibana: - Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g. **Last 15 minutes** if you used “now - 5m”) - Go to **Stack Monitoring → Elasticsearch → Overview** and confirm **Recent Log Entries** shows the row - Flip **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** between `Browser` and `UTC` and confirm the displayed timestamp shifts accordingly 4) Cleanup (optional): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true { "query": { "term": { "cluster_uuid": "tz-test-cluster" } } } ``` ```http POST logs-elasticsearch.*-*/_delete_by_query?refresh=true { "query": { "term": { "elasticsearch.cluster.uuid": "tz-test-cluster" } } } ``` # Release Note Fix Stack Monitoring Recent Log Entries timestamps to respect Kibana's time zone setting (`dateFormat:tz`). (cherry picked from commit 67cefd4)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 14, 2026
Closes elastic#120292 ## Summary The Stack Monitoring **Recent Log Entries** table now respects the Kibana `dateFormat:tz` advanced setting. ## Details - Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of `Browser`/`null`/unset as the browser-guessed timezone - Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as expected - Adds unit tests covering explicit timezone, `Browser`, and default/unset behavior ## Demo Current locale is UTC+1 (value should be 2:26) ### Before <img width="1718" height="1407" alt="SCR-20260114-myjp" src="https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868" /> ### After <img width="1720" height="1408" alt="SCR-20260114-mymj" src="https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378" /> ## Test plan - `node scripts/jest x-pack/platform/plugins/private/monitoring/common/formatting.test.ts` - Manual: change **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates ## Manual test data (optional) If you don't already have Stack Monitoring data available locally, you can create a minimal set of documents via **Kibana → Dev Tools → Console**. Pick values for: - `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z` - `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324` Then run: 1) Create a minimal cluster stats doc (note the `timestamp` field): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "timestamp": <EPOCH_MS>, "type": "cluster_stats", "metricset": { "name": "cluster_stats" }, "data_stream": { "type": "metrics", "dataset": "elasticsearch.stack_monitoring.cluster_stats", "namespace": "default" }, "cluster_uuid": "tz-test-cluster", "cluster_name": "tz-test-cluster", "license": { "status": "active", "type": "trial", "expiry_date_in_millis": 1894665600000 } } ``` 2) Create a minimal Elasticsearch server log doc for the same cluster: ```http POST logs-elasticsearch.server-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "message": "TZ regression test log entry - should show in browser timezone", "service": { "type": "elasticsearch" }, "event": { "dataset": "elasticsearch.server" }, "log": { "level": "INFO" }, "elasticsearch": { "cluster": { "uuid": "tz-test-cluster" }, "node": { "name": "test-node-1" }, "component": "test-component" } } ``` 3) In Kibana: - Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g. **Last 15 minutes** if you used “now - 5m”) - Go to **Stack Monitoring → Elasticsearch → Overview** and confirm **Recent Log Entries** shows the row - Flip **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** between `Browser` and `UTC` and confirm the displayed timestamp shifts accordingly 4) Cleanup (optional): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true { "query": { "term": { "cluster_uuid": "tz-test-cluster" } } } ``` ```http POST logs-elasticsearch.*-*/_delete_by_query?refresh=true { "query": { "term": { "elasticsearch.cluster.uuid": "tz-test-cluster" } } } ``` # Release Note Fix Stack Monitoring Recent Log Entries timestamps to respect Kibana's time zone setting (`dateFormat:tz`). (cherry picked from commit 67cefd4)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Jan 14, 2026
Closes elastic#120292 ## Summary The Stack Monitoring **Recent Log Entries** table now respects the Kibana `dateFormat:tz` advanced setting. ## Details - Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of `Browser`/`null`/unset as the browser-guessed timezone - Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as expected - Adds unit tests covering explicit timezone, `Browser`, and default/unset behavior ## Demo Current locale is UTC+1 (value should be 2:26) ### Before <img width="1718" height="1407" alt="SCR-20260114-myjp" src="https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868" /> ### After <img width="1720" height="1408" alt="SCR-20260114-mymj" src="https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378" /> ## Test plan - `node scripts/jest x-pack/platform/plugins/private/monitoring/common/formatting.test.ts` - Manual: change **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates ## Manual test data (optional) If you don't already have Stack Monitoring data available locally, you can create a minimal set of documents via **Kibana → Dev Tools → Console**. Pick values for: - `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z` - `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324` Then run: 1) Create a minimal cluster stats doc (note the `timestamp` field): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "timestamp": <EPOCH_MS>, "type": "cluster_stats", "metricset": { "name": "cluster_stats" }, "data_stream": { "type": "metrics", "dataset": "elasticsearch.stack_monitoring.cluster_stats", "namespace": "default" }, "cluster_uuid": "tz-test-cluster", "cluster_name": "tz-test-cluster", "license": { "status": "active", "type": "trial", "expiry_date_in_millis": 1894665600000 } } ``` 2) Create a minimal Elasticsearch server log doc for the same cluster: ```http POST logs-elasticsearch.server-default/_doc?refresh=wait_for { "@timestamp": "<ISO_TIMESTAMP>", "message": "TZ regression test log entry - should show in browser timezone", "service": { "type": "elasticsearch" }, "event": { "dataset": "elasticsearch.server" }, "log": { "level": "INFO" }, "elasticsearch": { "cluster": { "uuid": "tz-test-cluster" }, "node": { "name": "test-node-1" }, "component": "test-component" } } ``` 3) In Kibana: - Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g. **Last 15 minutes** if you used “now - 5m”) - Go to **Stack Monitoring → Elasticsearch → Overview** and confirm **Recent Log Entries** shows the row - Flip **Stack Management → Advanced Settings → Time zone (`dateFormat:tz`)** between `Browser` and `UTC` and confirm the displayed timestamp shifts accordingly 4) Cleanup (optional): ```http POST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true { "query": { "term": { "cluster_uuid": "tz-test-cluster" } } } ``` ```http POST logs-elasticsearch.*-*/_delete_by_query?refresh=true { "query": { "term": { "elasticsearch.cluster.uuid": "tz-test-cluster" } } } ``` # Release Note Fix Stack Monitoring Recent Log Entries timestamps to respect Kibana's time zone setting (`dateFormat:tz`). (cherry picked from commit 67cefd4)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Contributor
⏳ Build in-progress, with failures
Failed CI StepsTest Failures
History
|
kibanamachine
added a commit
that referenced
this pull request
Jan 15, 2026
…249115) # Backport This will backport the following commits from `main` to `9.3`: - [[Stack Monitoring] Fix Recent Log Entries timezone (#249016)](#249016) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-01-14T22:03:31Z","message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Monitoring","backport:all-open","v9.4.0"],"title":"[Stack Monitoring] Fix Recent Log Entries timezone","number":249016,"url":"https://github.com/elastic/kibana/pull/249016","mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/249016","number":249016,"mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Jan 15, 2026
…249113) # Backport This will backport the following commits from `main` to `9.1`: - [[Stack Monitoring] Fix Recent Log Entries timezone (#249016)](#249016) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-01-14T22:03:31Z","message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Monitoring","backport:all-open","v9.4.0"],"title":"[Stack Monitoring] Fix Recent Log Entries timezone","number":249016,"url":"https://github.com/elastic/kibana/pull/249016","mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/249016","number":249016,"mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Jan 15, 2026
…249114) # Backport This will backport the following commits from `main` to `9.2`: - [[Stack Monitoring] Fix Recent Log Entries timezone (#249016)](#249016) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-01-14T22:03:31Z","message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Monitoring","backport:all-open","v9.4.0"],"title":"[Stack Monitoring] Fix Recent Log Entries timezone","number":249016,"url":"https://github.com/elastic/kibana/pull/249016","mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/249016","number":249016,"mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Jan 15, 2026
…249112) # Backport This will backport the following commits from `main` to `8.19`: - [[Stack Monitoring] Fix Recent Log Entries timezone (#249016)](#249016) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Karen Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-01-14T22:03:31Z","message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:Monitoring","backport:all-open","v9.4.0"],"title":"[Stack Monitoring] Fix Recent Log Entries timezone","number":249016,"url":"https://github.com/elastic/kibana/pull/249016","mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/249016","number":249016,"mergeCommit":{"message":"[Stack Monitoring] Fix Recent Log Entries timezone (#249016)\n\nCloses #120292\n\n## Summary\nThe Stack Monitoring **Recent Log Entries** table now respects the\nKibana `dateFormat:tz` advanced setting.\n\n## Details\n- Fixes `formatDateTimeLocal` to treat `dateFormat:tz` values of\n`Browser`/`null`/unset as the browser-guessed timezone\n- Keeps explicit timezone values (e.g. `UTC`, `Asia/Seoul`) working as\nexpected\n- Adds unit tests covering explicit timezone, `Browser`, and\ndefault/unset behavior\n\n## Demo\n\nCurrent locale is UTC+1 (value should be 2:26)\n\n### Before\n<img width=\"1718\" height=\"1407\" alt=\"SCR-20260114-myjp\"\nsrc=\"https://github.com/user-attachments/assets/18659259-1fe1-4341-a5ce-66593bbad868\"\n/>\n\n### After\n<img width=\"1720\" height=\"1408\" alt=\"SCR-20260114-mymj\"\nsrc=\"https://github.com/user-attachments/assets/db5f5b96-5671-428f-8992-7bd017ce8378\"\n/>\n\n\n## Test plan\n- `node scripts/jest\nx-pack/platform/plugins/private/monitoring/common/formatting.test.ts`\n- Manual: change **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** and confirm the Recent Log Entries timestamp updates\n\n## Manual test data (optional)\nIf you don't already have Stack Monitoring data available locally, you\ncan create a minimal set of documents via **Kibana → Dev Tools →\nConsole**.\n\nPick values for:\n- `<ISO_TIMESTAMP>`: an ISO timestamp like `2026-01-14T16:07:52.324Z`\n- `<EPOCH_MS>`: the same moment as epoch millis like `1768406872324`\n\nThen run:\n\n1) Create a minimal cluster stats doc (note the `timestamp` field):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"timestamp\": <EPOCH_MS>,\n \"type\": \"cluster_stats\",\n \"metricset\": { \"name\": \"cluster_stats\" },\n \"data_stream\": { \"type\": \"metrics\", \"dataset\": \"elasticsearch.stack_monitoring.cluster_stats\", \"namespace\": \"default\" },\n \"cluster_uuid\": \"tz-test-cluster\",\n \"cluster_name\": \"tz-test-cluster\",\n \"license\": { \"status\": \"active\", \"type\": \"trial\", \"expiry_date_in_millis\": 1894665600000 }\n}\n```\n\n2) Create a minimal Elasticsearch server log doc for the same cluster:\n\n```http\nPOST logs-elasticsearch.server-default/_doc?refresh=wait_for\n{\n \"@timestamp\": \"<ISO_TIMESTAMP>\",\n \"message\": \"TZ regression test log entry - should show in browser timezone\",\n \"service\": { \"type\": \"elasticsearch\" },\n \"event\": { \"dataset\": \"elasticsearch.server\" },\n \"log\": { \"level\": \"INFO\" },\n \"elasticsearch\": {\n \"cluster\": { \"uuid\": \"tz-test-cluster\" },\n \"node\": { \"name\": \"test-node-1\" },\n \"component\": \"test-component\"\n }\n}\n```\n\n3) In Kibana:\n- Set the time picker to a range that includes `<ISO_TIMESTAMP>` (e.g.\n**Last 15 minutes** if you used “now - 5m”)\n- Go to **Stack Monitoring → Elasticsearch → Overview** and confirm\n**Recent Log Entries** shows the row\n- Flip **Stack Management → Advanced Settings → Time zone\n(`dateFormat:tz`)** between `Browser` and `UTC` and confirm the\ndisplayed timestamp shifts accordingly\n\n4) Cleanup (optional):\n\n```http\nPOST metrics-elasticsearch.stack_monitoring.cluster_stats-default/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"cluster_uuid\": \"tz-test-cluster\" } } }\n```\n\n```http\nPOST logs-elasticsearch.*-*/_delete_by_query?refresh=true\n{ \"query\": { \"term\": { \"elasticsearch.cluster.uuid\": \"tz-test-cluster\" } } }\n```\n\n# Release Note\nFix Stack Monitoring Recent Log Entries timestamps to respect Kibana's\ntime zone setting (`dateFormat:tz`).","sha":"67cefd4473e660c08caa2d8562fd3e730784fdc8"}}]}] BACKPORT--> Co-authored-by: Karen Grigoryan <karen.grigoryan@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #120292
Summary
The Stack Monitoring Recent Log Entries table now respects the Kibana
dateFormat:tzadvanced setting.Details
formatDateTimeLocalto treatdateFormat:tzvalues ofBrowser/null/unset as the browser-guessed timezoneUTC,Asia/Seoul) working as expectedBrowser, and default/unset behaviorDemo
Current locale is UTC+1 (value should be 2:26)
Before
After
Test plan
node scripts/jest x-pack/platform/plugins/private/monitoring/common/formatting.test.tsdateFormat:tz) and confirm the Recent Log Entries timestamp updatesManual test data (optional)
If you don't already have Stack Monitoring data available locally, you can create a minimal set of documents via Kibana → Dev Tools → Console.
Pick values for:
<ISO_TIMESTAMP>: an ISO timestamp like2026-01-14T16:07:52.324Z<EPOCH_MS>: the same moment as epoch millis like1768406872324Then run:
timestampfield):<ISO_TIMESTAMP>(e.g. Last 15 minutes if you used “now - 5m”)dateFormat:tz) betweenBrowserandUTCand confirm the displayed timestamp shifts accordinglyRelease Note
Fix Stack Monitoring Recent Log Entries timestamps to respect Kibana's time zone setting (
dateFormat:tz).