项目作者: cosmo0920

项目描述 :
Cloudwatch Logs input plugin for Embulk
高级语言: Java
项目地址: git://github.com/cosmo0920/embulk-input-cloudwatch_logs.git
创建时间: 2020-03-26T09:05:05Z
项目社区:https://github.com/cosmo0920/embulk-input-cloudwatch_logs

开源协议:MIT License

下载


Cloudwatch Logs input plugin for Embulk

Overview

  • Plugin type: input
  • Resume supported: no
  • Cleanup supported: yes
  • Guess supported: no

Configuration

  • log_group_name: CloudWathcLogs log group name (string, required)

  • log_stream_name: CloudWathcLogs log stream name (string, default: null)

  • use_log_stream_name_prefix: Whether using log_stream_name as stream name prefix (boolean, default: false)

  • column_name: Column name for CloudWatchLogs’ message column (string, default: "message")

  • start_time: CloudWatchLogs start-time (string, optional, default: null)

  • end_time: CloudWatchLogs end-time (string, optional, default: null)

  • time_range_format: Time range format. Internally, it will be used as yyyy-MM-dd HH:mm:ss by default. (string, optional, default: null)

  • region CloudWatchLogs region. Currently this should be required. (string, optional)

  • authentication_method: name of mechanism to authenticate requests (basic, env, instance, profile, properties, anonymous, or session. default: basic)

    • “basic”: uses access_key_id and secret_access_key to authenticate.

      • aws_access_key_id: AWS access key ID (string, required)

      • aws_secret_access_key: AWS secret access key (string, required)

    • “env”: uses AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY) environment variables.

    • “instance”: uses EC2 instance profile.

    • “profile”: uses credentials written in a file. Format of the file is as following, where [...] is a name of profile.

      • aws_profile_file: path to a profiles file. (string, default: given by AWS_CREDENTIAL_PROFILES_FILE environment varialbe, or ~/.aws/credentials).

      • aws_profile_name: name of a profile. (string, default: "default")

      1. [default]
      2. aws_access_key_id=YOUR_ACCESS_KEY_ID
      3. aws_secret_access_key=YOUR_SECRET_ACCESS_KEY
      4. [profile2]
      5. ...
    • “properties”: uses aws.accessKeyId and aws.secretKey Java system properties.

    • “anonymous”: uses anonymous access. This auth method can access only public files.

    • “session”: uses temporary-generated access_key_id, secret_access_key and session_token.

      • aws_access_key_id: AWS access key ID (string, required)

      • aws_secret_access_key: AWS secret access key (string, required)

      • aws_session_token: session token (string, required)

    • “default”: uses AWS SDK’s default strategy to look up available credentials from runtime environment. This method behaves like the combination of the following methods.

      1. “env”
      2. “properties”
      3. “profile”
      4. “instance”

Example

  1. in:
  2. type: cloudwatch_logs
  3. log_group_name: fluentd
  4. log_stream_name: cloudwatchlogs_test
  5. use_log_stream_name_prefix: true
  6. region: ap-northeast-1
  7. aws_access_key_id: ABCXYZ123ABCXYZ123
  8. aws_secret_access_key: AbCxYz123aBcXyZ123

Specifying time range is also supported.
start_time and end_time are corresponds to startTime and endTime in GetLogEvents request.
They are handled as number of milliseconds after Jan 1, 1970 00:00:00 UTC.

ref: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html#API_GetLogEvents_RequestSyntax

  1. start_time: 2020-01-18 00:00:00Z
  2. end_time: 2020-03-20 00:00:00Z
  3. time_range_format: "YY-MM-dd HH:mm:ss'Z'"

To use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables:

  1. in:
  2. type: cloudwatch_logs
  3. log_group_name: fluentd
  4. log_stream_name: cloudwatchlogs_test
  5. use_log_stream_name_prefix: true
  6. region: ap-northeast-1
  7. authentication_method: env

Build

  1. $ ./gradlew gem # -t to watch change of files and rebuild continuously