Skip to content

create dynamic index key using record_transformer #3978

Discussion options

You must be logged in to vote

Managed to do it

<filter kubernetes.**>
  @type record_transformer
  enable_ruby true
  <record>
    index_name ${if record["kubernetes"]["labels"].include? "serviceName"; record["index_name"] = record["kubernetes"]["labels"]["serviceName"] ; else; "Default" end;}
  </record>
</filter>

Thanks anyway.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@a-masoumian
Comment options

@yakir-shriker
Comment options

@a-masoumian
Comment options

Answer selected by fujimotos
Comment options

You must be logged in to vote
1 reply
@a-masoumian
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants