スキップしてコンテンツを表示

cloud watch log groups only show utc times

0

How can we change the date format to allow local time. Seems it only displays utc. Here is a screenshot.

Log Group Screen Shot

3回答
5

Hello,

To display CloudWatch logs in local time instead of UTC, you need to adjust the time zone settings in CloudWatch Logs Insights queries. Here’s a concise guide:

1.Modify Queries: Use the start, end, and parse functions in CloudWatch Logs Insights to adjust timestamps to your local time zone.

2.Example Query:

filter @timestamp > parse('2024-06-13 00:00:00', 'yyyy-MM-dd HH:mm:ss', 'America/New_York')
| filter @timestamp < parse('2024-06-14 00:00:00', 'yyyy-MM-dd HH:mm:ss', 'America/New_York')

Replace 'America/New_York' with your local time zone (e.g., 'Asia/Tokyo').

https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html By adjusting your queries with the appropriate time zone, CloudWatch Logs Insights will display logs in your desired local time format.

エキスパート
回答済み 1年前
エキスパート
レビュー済み 1年前
3

Hi,

Answer to this StackOverflow question gives you the answer: https://stackoverflow.com/questions/51887396/setting-the-same-timezone-everywhere-in-cloudwatch

Best,

Didier

エキスパート
回答済み 1年前
エキスパート
レビュー済み 1年前
エキスパート
レビュー済み 1年前
2

Hello,

CloudWatch Logs timestamps are in UTC by default, but you can easily view them in your local time zone within the console. Here's how:

  • Go to the CloudWatch Logs section.
  • Find the Log Group you want.
  • Click the "Custom" dropdown menu in the top right corner.
  • Choose "Local timezone" to display timestamps in your local time.

This won't change the actual timestamps in the logs, but it makes them easier to read. For more advanced options and working with local time consistently, explore CloudWatch Logs Insights queries [AWS CloudWatch Documentation on working with log groups and log streams]:(https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html).

エキスパート
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ