elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
103 stars 4.92k forks source link

[filebeat][o365] Mapping problem on o365.audit.Parameters #22780

Open willemdh opened 3 years ago

willemdh commented 3 years ago

Error:

Cache:publisher.EventCache{m:common.MapStr(nil)}} (status=400): {"type":"mapper_parsing_exception","reason":"object mapping for [o365.audit.Parameters] tried to parse field [Parameters] as object, but found a concrete value"}

Workaround:

- drop_fields:
    when:
      equals:
        event.module: 'o365'
    fields: ["o365.audit.Parameters"]
elasticmachine commented 3 years ago

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

cakarlen commented 3 years ago

Bump on this issue as I experienced this exact error as OP described above when turning up o365 logging. Verified my Azure app has the correct permissions and manually tested API creds to verify

willemdh commented 3 years ago

@cakarlen The workaround works fine for me, but we shouldnt have to do this..

P1llus commented 3 years ago

Some quick updates on this, sorry for the silence here. The 7.13.2 filebeat module has an update for this: https://github.com/elastic/beats/pull/26164

For the package(fleet version), it will come out with a requirement of 7.14, as the package has some features that it is required for. This can be followed here: https://github.com/elastic/integrations/pull/1136

The current implementation will copy the Parameters field to Parameters._raw if its a string. This is to make sure that ingestion works. A later version we might want to come back and build more parsers for these string fields, but the current issue is that the string values in the parameters field does not follow a specific format, and varies quite a lot, so this will have to be the initial change.

kh31r0n commented 2 years ago
botelastic[bot] commented 1 year ago

Hi! We just realized that we haven't looked into this issue in a while. We're sorry!

We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

willemdh commented 1 year ago

+1

willemdh commented 1 year ago

Multiple interesting fields are also unmapped and hence unusable for filtering / aggregating etc;.

For example

o365.audit.ExtendedProperties.RequestType o365.audit.ExtendedProperties.ResultStatusDetail o365.audit.ExtendedProperties.UserAuthenticationMethod

novaksam commented 1 year ago

Also having this issue, with o365.audit.Platform It appears that some of the most common events have a platform of '1', triggering numeric detection, and breaking future events.

novaksam commented 1 year ago

I'm using the following logstash filter to prune/handle some of this


  if [o365] {
    if [o365][audit][platform] == "1" {
      mutate {
        replace => { "[o365][audit][platform]" => "one"}
      }
    }

    # "reason"=>"mapper [o365.audit.FileSizeBytes] cannot be changed from type [long] to [float]"}}}
    if [o365][audit][FileSizeBytes] =~ \.\d*$ {
      mutate {
        convert => {
          "[o365][audit][FileSizeBytes]" => "integer"
        }
      }
    }
  }`
elasticmachine commented 9 months ago

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)