
Amazon CloudWatch Logs User Guide Amazon CloudWatch Logs User Guide Amazon CloudWatch Logs: User Guide Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved. Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. Amazon CloudWatch Logs User Guide Table of Contents What is Amazon CloudWatch Logs? ...................................................................................................... 1 Features .................................................................................................................................... 1 Related AWS services .................................................................................................................. 1 Pricing ...................................................................................................................................... 2 Concepts ................................................................................................................................... 2 Getting set up ................................................................................................................................... 4 Sign up for Amazon Web Services ................................................................................................ 4 Sign in to the Amazon CloudWatch console .................................................................................. 4 Set up the Command Line Interface ............................................................................................. 4 Getting started .................................................................................................................................. 5 Use the unified CloudWatch agent to get started With CloudWatch Logs ........................................... 5 Use the previous CloudWatch Logs agent to get started with CloudWatch Logs .................................. 6 CloudWatch Logs agent prerequisites ................................................................................... 6 Quick Start: Install the agent on a running EC2 Linux instance ................................................. 6 Quick Start: Install the agent on an EC2 Linux instance at launch ............................................ 10 Quick Start: Use CloudWatch Logs with Windows Server 2016 instances .................................. 13 Quick Start: Use CloudWatch Logs with Windows Server 2012 and Windows Server 2008 instances ......................................................................................................................... 20 Quick Start: Install the agent using AWS OpsWorks .............................................................. 26 Report the CloudWatch Logs agent status ........................................................................... 30 Start the CloudWatch Logs agent ....................................................................................... 31 Stop the CloudWatch Logs agent ....................................................................................... 31 Quick Start: Use AWS CloudFormation to get started with CloudWatch Logs .................................... 31 Analyzing log data with CloudWatch Logs Insights ............................................................................... 33 Supported logs and discovered fields .......................................................................................... 34 Fields in JSON logs ........................................................................................................... 35 Tutorial: Run and modify a sample query .................................................................................... 36 Run a sample query ......................................................................................................... 36 Modify the sample query .................................................................................................. 36 Add a filter command to the sample query ......................................................................... 37 Tutorial: Run a query with an aggregation function ...................................................................... 38 Tutorial: Run a query that produces a visualization grouped by log fields ......................................... 38 Tutorial: Run a query that produces a time series visualization ....................................................... 39 Query syntax ........................................................................................................................... 39 Supported query commands .............................................................................................. 39 Matches and regular expressions in the filter command ......................................................... 44 Using aliases in queries ..................................................................................................... 44 Using comments in queries ................................................................................................ 45 Supported operations and functions ................................................................................... 45 Visualizing log data in graphs .................................................................................................... 50 Visualizing time series data ............................................................................................... 50 Visualizing log data grouped by fields ................................................................................. 51 Saving and re-running queries ................................................................................................... 51 Sample queries ........................................................................................................................ 53 Add query to dashboard or export query results .......................................................................... 55 View running queries or query history ....................................................................................... 56 Working with log groups and log streams ........................................................................................... 57 Create a log group ................................................................................................................... 57 Send logs to a log group .......................................................................................................... 57 View log data .......................................................................................................................... 57 Search log data using filter patterns ........................................................................................... 58 Search log entries using the console ................................................................................... 58 Search log entries using the AWS CLI .................................................................................. 58 Pivot from metrics to logs ................................................................................................. 59 iii Amazon CloudWatch Logs User Guide Troubleshooting ............................................................................................................... 59 Change log data retention ......................................................................................................... 60 Tag log groups ......................................................................................................................... 60 Tag basics ....................................................................................................................... 60 Tracking costs using tagging .............................................................................................. 61 Tag restrictions ................................................................................................................ 61 Tagging log groups using the AWS CLI ................................................................................ 61 Tagging log groups using the CloudWatch Logs API .............................................................. 62 Encrypt log data using AWS KMS ............................................................................................... 62 Limits ............................................................................................................................. 63 Step 1: Create an AWS KMS customer managed key ............................................................. 63 Step 2: Set permissions on the customer managed key ......................................................... 63 Step 3: Associate a log group with a customer managed key .................................................. 65 Step 4: Disassociate a log group from a CMK ....................................................................... 65 KMS keys and encryption context ....................................................................................... 66 Creating metrics from log events using filters ...................................................................................... 69 Concepts ................................................................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages179 Page
-
File Size-