Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make field names in Functionbeat ECS compliant #16000

Merged
merged 3 commits into from
Feb 3, 2020

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Jan 31, 2020

What does this PR do?

This PR fixes an issue in the storage function of Functionbeat. ES was not able to index events coming from the function as one of its fields had a different type:

{
    "textPayload": "2020-01-31T15:03:10.758Z\tWARN\telasticsearch/client.go:516\tCannot index event publisher.Event{Content:beat.Event{Timestamp:time.Time{wall:0xf60c480, ext:63716079787, loc:(*time.Location)(nil)}, Meta:null, Fields:{\"agent\":{\"ephemeral_id\":\"d86f3440-cb23-431a-81b7-d3360017ad2b\",\"hostname\":\"localhost\",\"id\":\"1a0a7af8-b927-460f-9746-7f8eae8dd417\",\"type\":\"functionbeat\",\"version\":\"7.6.0\"},\"bucket\":\"test-elastic-bucket\",\"created\":\"2020-01-31T15:03:06.783Z\",\"ecs\":{\"version\":\"1.4.0\"},\"file\":\"Untitled\",\"host\":{\"name\":\"localhost\"},\"id\":\"951771144251331\",\"metageneration\":\"1\",\"read_timestamp\":\"2020-01-31T15:03:10.209Z\",\"resource\":{\"event_type\":\"storage#object\",\"name\":\"projects/_/buckets/test-elastic-bucket/objects/Untitled\",\"service\":\"storage.googleapis.com\",\"state\":\"\"},\"updated\":\"2020-01-31T15:03:06.783Z\"}, Private:interface {}(nil), TimeSeries:false}, Flags:0x1, Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {\"type\":\"mapper_parsing_exception\",\"reason\":\"object mapping for [file] tried to parse field [file] as object, but found a concrete value\"}",
    "insertId": "000000-4f927011-4af5-4876-b471-62889ff0796b",
    "resource": {
      "type": "cloud_function",
      "labels": {
        "project_id": "elastic-metricbeat",
        "region": "europe-west2",
        "function_name": "storage"
      }
    },
    "timestamp": "2020-01-31T15:03:10.758Z",
    "labels": {
      "execution_id": "951771144251331"
    },
    "logName": "projects/elastic-metricbeat/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
    "trace": "projects/elastic-metricbeat/traces/571a3f3523594e819691f0672c32c413",
    "receiveTimestamp": "2020-01-31T15:03:12.107405704Z"
  }

Why is it important?

This problem prevented ES from indexing new storage events.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works

@kvch kvch added needs_backport PR is waiting to be backported to other branches. [zube]: In Review Team:Services (Deprecated) Label for the former Integrations-Services team labels Jan 31, 2020
@kvch kvch changed the title Make field names in Functionbeat more specific to the Beat Make field names in Functionbeat ECS compliant Feb 3, 2020
@kvch kvch merged commit 0347762 into elastic:master Feb 3, 2020
kvch added a commit to kvch/beats that referenced this pull request Feb 3, 2020
This PR fixes an issue in the `storage` function of Functionbeat. ES was not able to index events coming from the function as one of its fields had a different type:

```
{
    "textPayload": "2020-01-31T15:03:10.758Z\tWARN\telasticsearch/client.go:516\tCannot index event publisher.Event{Content:beat.Event{Timestamp:time.Time{wall:0xf60c480, ext:63716079787, loc:(*time.Location)(nil)}, Meta:null, Fields:{\"agent\":{\"ephemeral_id\":\"d86f3440-cb23-431a-81b7-d3360017ad2b\",\"hostname\":\"localhost\",\"id\":\"1a0a7af8-b927-460f-9746-7f8eae8dd417\",\"type\":\"functionbeat\",\"version\":\"7.6.0\"},\"bucket\":\"test-elastic-bucket\",\"created\":\"2020-01-31T15:03:06.783Z\",\"ecs\":{\"version\":\"1.4.0\"},\"file\":\"Untitled\",\"host\":{\"name\":\"localhost\"},\"id\":\"951771144251331\",\"metageneration\":\"1\",\"read_timestamp\":\"2020-01-31T15:03:10.209Z\",\"resource\":{\"event_type\":\"storage#object\",\"name\":\"projects/_/buckets/test-elastic-bucket/objects/Untitled\",\"service\":\"storage.googleapis.com\",\"state\":\"\"},\"updated\":\"2020-01-31T15:03:06.783Z\"}, Private:interface {}(nil), TimeSeries:false}, Flags:0x1, Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {\"type\":\"mapper_parsing_exception\",\"reason\":\"object mapping for [file] tried to parse field [file] as object, but found a concrete value\"}",
    "insertId": "000000-4f927011-4af5-4876-b471-62889ff0796b",
    "resource": {
      "type": "cloud_function",
      "labels": {
        "project_id": "elastic-metricbeat",
        "region": "europe-west2",
        "function_name": "storage"
      }
    },
    "timestamp": "2020-01-31T15:03:10.758Z",
    "labels": {
      "execution_id": "951771144251331"
    },
    "logName": "projects/elastic-metricbeat/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
    "trace": "projects/elastic-metricbeat/traces/571a3f3523594e819691f0672c32c413",
    "receiveTimestamp": "2020-01-31T15:03:12.107405704Z"
  }
```

This problem prevented ES from indexing new storage events.

(cherry picked from commit 0347762)
@kvch kvch added v7.7.0 and removed needs_backport PR is waiting to be backported to other branches. labels Feb 3, 2020
kvch added a commit to kvch/beats that referenced this pull request Feb 3, 2020
This PR fixes an issue in the `storage` function of Functionbeat. ES was not able to index events coming from the function as one of its fields had a different type:

```
{
    "textPayload": "2020-01-31T15:03:10.758Z\tWARN\telasticsearch/client.go:516\tCannot index event publisher.Event{Content:beat.Event{Timestamp:time.Time{wall:0xf60c480, ext:63716079787, loc:(*time.Location)(nil)}, Meta:null, Fields:{\"agent\":{\"ephemeral_id\":\"d86f3440-cb23-431a-81b7-d3360017ad2b\",\"hostname\":\"localhost\",\"id\":\"1a0a7af8-b927-460f-9746-7f8eae8dd417\",\"type\":\"functionbeat\",\"version\":\"7.6.0\"},\"bucket\":\"test-elastic-bucket\",\"created\":\"2020-01-31T15:03:06.783Z\",\"ecs\":{\"version\":\"1.4.0\"},\"file\":\"Untitled\",\"host\":{\"name\":\"localhost\"},\"id\":\"951771144251331\",\"metageneration\":\"1\",\"read_timestamp\":\"2020-01-31T15:03:10.209Z\",\"resource\":{\"event_type\":\"storage#object\",\"name\":\"projects/_/buckets/test-elastic-bucket/objects/Untitled\",\"service\":\"storage.googleapis.com\",\"state\":\"\"},\"updated\":\"2020-01-31T15:03:06.783Z\"}, Private:interface {}(nil), TimeSeries:false}, Flags:0x1, Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {\"type\":\"mapper_parsing_exception\",\"reason\":\"object mapping for [file] tried to parse field [file] as object, but found a concrete value\"}",
    "insertId": "000000-4f927011-4af5-4876-b471-62889ff0796b",
    "resource": {
      "type": "cloud_function",
      "labels": {
        "project_id": "elastic-metricbeat",
        "region": "europe-west2",
        "function_name": "storage"
      }
    },
    "timestamp": "2020-01-31T15:03:10.758Z",
    "labels": {
      "execution_id": "951771144251331"
    },
    "logName": "projects/elastic-metricbeat/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
    "trace": "projects/elastic-metricbeat/traces/571a3f3523594e819691f0672c32c413",
    "receiveTimestamp": "2020-01-31T15:03:12.107405704Z"
  }
```

This problem prevented ES from indexing new storage events.

(cherry picked from commit 0347762)
@kvch kvch added the v7.6.0 label Feb 3, 2020
kvch added a commit that referenced this pull request Feb 4, 2020
This PR fixes an issue in the `storage` function of Functionbeat. ES was not able to index events coming from the function as one of its fields had a different type:

```
{
    "textPayload": "2020-01-31T15:03:10.758Z\tWARN\telasticsearch/client.go:516\tCannot index event publisher.Event{Content:beat.Event{Timestamp:time.Time{wall:0xf60c480, ext:63716079787, loc:(*time.Location)(nil)}, Meta:null, Fields:{\"agent\":{\"ephemeral_id\":\"d86f3440-cb23-431a-81b7-d3360017ad2b\",\"hostname\":\"localhost\",\"id\":\"1a0a7af8-b927-460f-9746-7f8eae8dd417\",\"type\":\"functionbeat\",\"version\":\"7.6.0\"},\"bucket\":\"test-elastic-bucket\",\"created\":\"2020-01-31T15:03:06.783Z\",\"ecs\":{\"version\":\"1.4.0\"},\"file\":\"Untitled\",\"host\":{\"name\":\"localhost\"},\"id\":\"951771144251331\",\"metageneration\":\"1\",\"read_timestamp\":\"2020-01-31T15:03:10.209Z\",\"resource\":{\"event_type\":\"storage#object\",\"name\":\"projects/_/buckets/test-elastic-bucket/objects/Untitled\",\"service\":\"storage.googleapis.com\",\"state\":\"\"},\"updated\":\"2020-01-31T15:03:06.783Z\"}, Private:interface {}(nil), TimeSeries:false}, Flags:0x1, Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {\"type\":\"mapper_parsing_exception\",\"reason\":\"object mapping for [file] tried to parse field [file] as object, but found a concrete value\"}",
    "insertId": "000000-4f927011-4af5-4876-b471-62889ff0796b",
    "resource": {
      "type": "cloud_function",
      "labels": {
        "project_id": "elastic-metricbeat",
        "region": "europe-west2",
        "function_name": "storage"
      }
    },
    "timestamp": "2020-01-31T15:03:10.758Z",
    "labels": {
      "execution_id": "951771144251331"
    },
    "logName": "projects/elastic-metricbeat/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
    "trace": "projects/elastic-metricbeat/traces/571a3f3523594e819691f0672c32c413",
    "receiveTimestamp": "2020-01-31T15:03:12.107405704Z"
  }
```

This problem prevented ES from indexing new storage events.

(cherry picked from commit 0347762)
kvch added a commit that referenced this pull request Feb 4, 2020
This PR fixes an issue in the `storage` function of Functionbeat. ES was not able to index events coming from the function as one of its fields had a different type:

```
{
    "textPayload": "2020-01-31T15:03:10.758Z\tWARN\telasticsearch/client.go:516\tCannot index event publisher.Event{Content:beat.Event{Timestamp:time.Time{wall:0xf60c480, ext:63716079787, loc:(*time.Location)(nil)}, Meta:null, Fields:{\"agent\":{\"ephemeral_id\":\"d86f3440-cb23-431a-81b7-d3360017ad2b\",\"hostname\":\"localhost\",\"id\":\"1a0a7af8-b927-460f-9746-7f8eae8dd417\",\"type\":\"functionbeat\",\"version\":\"7.6.0\"},\"bucket\":\"test-elastic-bucket\",\"created\":\"2020-01-31T15:03:06.783Z\",\"ecs\":{\"version\":\"1.4.0\"},\"file\":\"Untitled\",\"host\":{\"name\":\"localhost\"},\"id\":\"951771144251331\",\"metageneration\":\"1\",\"read_timestamp\":\"2020-01-31T15:03:10.209Z\",\"resource\":{\"event_type\":\"storage#object\",\"name\":\"projects/_/buckets/test-elastic-bucket/objects/Untitled\",\"service\":\"storage.googleapis.com\",\"state\":\"\"},\"updated\":\"2020-01-31T15:03:06.783Z\"}, Private:interface {}(nil), TimeSeries:false}, Flags:0x1, Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {\"type\":\"mapper_parsing_exception\",\"reason\":\"object mapping for [file] tried to parse field [file] as object, but found a concrete value\"}",
    "insertId": "000000-4f927011-4af5-4876-b471-62889ff0796b",
    "resource": {
      "type": "cloud_function",
      "labels": {
        "project_id": "elastic-metricbeat",
        "region": "europe-west2",
        "function_name": "storage"
      }
    },
    "timestamp": "2020-01-31T15:03:10.758Z",
    "labels": {
      "execution_id": "951771144251331"
    },
    "logName": "projects/elastic-metricbeat/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
    "trace": "projects/elastic-metricbeat/traces/571a3f3523594e819691f0672c32c413",
    "receiveTimestamp": "2020-01-31T15:03:12.107405704Z"
  }
```

This problem prevented ES from indexing new storage events.

(cherry picked from commit 0347762)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Services (Deprecated) Label for the former Integrations-Services team v7.6.0 v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants