No release in over a year
Specify log groups and filters to generate CloudWatch Logs Insights URL accessible to AWS Console.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
 Project Readme

cloudwatch_logs_url_builder

rspec License: MIT

Generate AWS Console URL for Amazon CloudWatch Insights.

Installation

gem 'cloudwatch_logs_insights_url_builder'

Usage

require 'cloudwatch_logs_insights_url_builder'

builder = CloudWatchLogsInsightsUrlBuilder.new
builder.time_type = 'ABSOLUTE'
builder.start_time = Time.utc(2023, 1, 27, 0, 0, 0)
builder.end_time = Time.utc(2023, 1, 27, 23, 59, 59)
builder.timezone = 'UTC'
builder.log_groups = ['/aws/cloudtrail']

# https://us-east-1.console.aws.amazon.com/cloudwatch/home?...
builder.log_insights_url("fields @timestamp, @message, @logStream, @log\n| sort @timestamp desc\n| limit 20")

The generated URL can be used to open the CloudWatch Insights page from a browser.

Screen Shot 2023-01-29 at 1 41 47