Referencing captured groups inside yaml file

Hello, I'm running the postgresql module in metricbeat with the statement metricset active, i want to be able to determine the type of the query (insert, update, select or delete),
so i add an add_fields processor with a regexp condition to match a certain pattern that includes a captured group and i want the captured string of that group to be add as a value for the created field, the problem is i don't know how to reference the captured group in the processor config, this is what i have tried:

processors:
    - add_fields:
        when:
          regexp:
             postgresql.statement.query.text: (?i)(?:\/\*.*\*\/)?(select|insert|update|delete)+.*
        target: postgresql
        fields:
            statement.query.type: "..." #here is where i want the captured group to be refrenced

I made these attempts but with no luck:

postgresql.statement.query.text: $1
postgresql.statement.query.text: %{$1}
postgresql.statement.query.text: %{1}
postgresql.statement.query.text: %{[1]}

Is this even possible ?

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