<p>I am new to Stackoverflow, puppet and kubernetes as well. </p>

<p>I need to create an if conditional, to check if a certain label exist in the environment field for kubernetes label in Kibana Filters, using puppet and if it does not exist it will add it.
 This is what I have so far, and where reads ??  -is where I am not sure what goes there, I have tought about setting a regex, </p>

<pre><code>if [kubernetes] {   
  if [kubernetes][labels][app_kubernetes_io\/environment] = ?? {
    mutate { add_field =&gt; { "environment" =&gt; [kubernetes][labels][app_kubernetes_io\/environment]  } }  
}

</code></pre>

anakin.thegardner
<p>Solution:</p>

<p>} if [kubernetes][labels][app_kubernetes_io/environment] {
  mutate { add_field => { "environment" => "%{[kubernetes][labels][app_kubernetes_io/environment]}" } }
}</p>
