Skip to content

Is if record.dig exists else null exclude even possible?  #65

Description

@aydosman

Loving the modifier, I'm trying to work on filtering records which are null adding an if statement, I’ve seen a few examples, but none match my use case. Has anyone come across this or can confirm its even possible?

Human readable action

partOf = 
if record.dig("kubernetes", "labels", "app.kubernetes.io/part-of").Value exists include record and value
else
remove_keys partOf

example dig

    <filter **>
      @type record_modifier
      <record>
        partOf ${record.dig("kubernetes", "labels", "app.kubernetes.io/part-of")}
      </record>
    </filter>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions