I want to retrieve data from the cloudwatch dashboard from the cli

Asked 1 years ago, Updated 1 years ago, 52 views

I just set up the dashboard on Cloudwatch on the aws console.

Of course, you can check this data by logging in to the console, but it was inconvenient that you had to log in to the console one by one if you worked across multiple accounts or gave security (two-step authentication).

  • Can I retrieve data from the dashboard defined on the aws cloudwatch from the cli?
    • For example, if you specify a time period, it would be nice if the data from that dashboard were returned to json and so on.
  • For example, if you specify a time period, it would be nice if the data from that dashboard were returned to json and so on.

aws aws-cloudwatch

2022-09-30 21:43

1 Answers

When I googled "aws cloudwatch cli", the document became a hit.

get-dashboard—AWS CLI 1.16.230 Command Reference

get-dashboard
  --dashboard-name <value>
 [--cli-input-json<value>]
 [--generate-cli-skeleton <value>]

The output appears to include DashboardBody->(string).
It seems to be a JSON format, but please refer to the format details below.

Dashboard Body Structure and Syntax-Amazon CloudWatch


2022-09-30 21:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.