# How to segregate cloudwatch logs using functionbeat?

**URL:** <https://discuss.elastic.co/t/how-to-segregate-cloudwatch-logs-using-functionbeat/233631>\
**Category:** Beats\
**Tags:** functionbeat\
**Created:** [May 20, 2020, 11:38pm UTC](https://discuss.elastic.co/t/how-to-segregate-cloudwatch-logs-using-functionbeat/233631 "2020-05-20T23:38:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marksantosph](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@marksantosph](https://discuss.elastic.co/u/marksantosph)\
**Post date:** [May 20, 2020, 11:38pm UTC](https://discuss.elastic.co/t/how-to-segregate-cloudwatch-logs-using-functionbeat/233631/1 "2020-05-20T23:38:59Z")

</div>

I am trying to segregate cloudwatch logs using functionbeat. I deployed two lambda functions having different log group name, function name and deploy bucket. The goal is to get logs from two different environments and view them in kibana separately. I am not quite sure what is the right way to do this. Would it be setting up two different index names? Here's my functionbeat.yml:

```
functionbeat.provider.aws.endpoint: "s3.amazonaws.com"
functionbeat.provider.aws.deploy_bucket: "fb-dev"
functionbeat.provider.aws.functions:
  - name: fb-cw-logs-dev
    enabled: true
    type: cloudwatch_logs
    description: "lambda function for cloudwatch logs in dev"
    triggers:
      - log_group_name: dev-api-logs

cloud.id: " *****"
cloud.auth: " *****:*****"

output.elasticsearch:
  index: "dev-api-logs-%{[agent.version]}-%{+yyyy.MM.dd}"

setup.template.enabled: true
setup.template.name: "dev-api-logs-%{[agent.version]}-*"
setup.template.pattern: "dev-api-logs-%{[agent.version]}-*"
setup.template.overwrite: true
setup.template.settings:
  enabled: true
setup.ilm.enabled: false
setup.ilm.rollover_alias: "dev-api-logs"
    
processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 10, 2020, 1:39pm UTC](https://discuss.elastic.co/t/how-to-segregate-cloudwatch-logs-using-functionbeat/233631/2 "2020-06-10T13:39:00Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
