<p>I only want to run my pipeline on files where the log path contains a certain keyword, how do I do this within the pipeline?</p>
<p>Pipeline (removed my pattern and patterns as it is not relevant):</p>
<pre><code>{
  &quot;description&quot; : &quot;...&quot;,
  &quot;processors&quot;: [
    {
      &quot;grok&quot;: {
        &quot;if&quot;: &quot;ctx['log']['file']['path'].value.contains('keyword')&quot;,
        &quot;field&quot;: &quot;message&quot;,
      }
    }
  ]
}
</code></pre>
<p>In Kibana I see I have log.file.path available as metadata, and I just want to run the pipeline if it contains a keyword, but I get a runtime error because of my if statement.</p>
<p>Thanks for your help!</p>
<p>EDIT: I think the problem lies with how I am trying to access the log.file.path field as I don't know how to reference it correctly from here.</p>

OultimoCoder
<p>You can probably use the Drop processor
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/drop-processor.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/drop-processor.html</a></p>
<pre><code>&quot;drop&quot;: {
   &quot;if&quot;: &quot;ctx.log.file.path.contains('keyword');&quot;
}
</code></pre>
<p>You can find more complexe exemples here:
<a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest-conditional-complex.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/master/ingest-conditional-complex.html</a></p>
