Skip to content

Logstash-output-s3 can't save logs on many bucket.  #37

@vankhoa011

Description

@vankhoa011

Hi all,

I make a config for logstash ,
I want if the logs match logtype==request and env==prd , it will save to Bucket 1
If the logstash logtype==request and env==stg , i will save to Bucket2.
However, all logs are save on Bucket 1.

In the beginning , I think there is something wrong with my configure or logstash condition didn't work properly.

So I tried to remove configure which save logs on Bucket2 to check the conditional logstash.
However, it worked correctly.

That's why I think the logstash output-s3 don't allow to save logs on many buckets.

output {

  if [logtype] == "request" and [env] == "prd" {
    s3 {
        access_key_id => "XXX"
        secret_access_key => "XXX"
        bucket => "XXX1"
        endpoint_region => "us-east-1"
        time_file => 1
    }
  }
  if [logtype] == "request" and [env] == "stg" {
    s3 {
      access_key_id => "XXX"
      secret_access_key => "XXX"
      bucket => "XXX2"
      endpoint_region => "us-east-1"
      time_file => 1
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions