fluent-plugin-record-modifier icon indicating copy to clipboard operation
fluent-plugin-record-modifier copied to clipboard

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

Open aydosman opened this issue 3 years ago • 0 comments

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>

aydosman avatar Feb 10 '22 14:02 aydosman