# Can Someone help with writing a javascript processor in filebeat configuration file

**URL:** <https://discuss.elastic.co/t/can-someone-help-with-writing-a-javascript-processor-in-filebeat-configuration-file/358416>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 29, 2024, 11:00am UTC](https://discuss.elastic.co/t/can-someone-help-with-writing-a-javascript-processor-in-filebeat-configuration-file/358416 "2024-04-29T11:00:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saxena\_shk7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saxena_shk7/32/132741_2.png) [@saxena\_shk7](https://discuss.elastic.co/u/saxena_shk7)\
**Post date:** [April 29, 2024, 11:00am UTC](https://discuss.elastic.co/t/can-someone-help-with-writing-a-javascript-processor-in-filebeat-configuration-file/358416/1 "2024-04-29T11:00:44Z")

</div>

Can Someone help with writing a java-script processor in a filebeat configuration file. I want to index all documents of a JSON response from a URL endpoint which do not have a field value "name" equals to 'PG3' in it. ie. (It should index documents with "name" field with any value execpt PG3).

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [May 1, 2024, 8:55am UTC](https://discuss.elastic.co/t/can-someone-help-with-writing-a-javascript-processor-in-filebeat-configuration-file/358416/2 "2024-05-01T08:55:41Z")

</div>

Hi @saxena_shk7,

Do you have an existing configuration that you are working with? Which version of Filebeat are you using?

I don't believe you need to use a JavaScript processor for this. Have you tried using a [HTTP endpoint input](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-http_endpoint.html) to pull the messages, and then process the messages using a [drop processor](https://www.elastic.co/guide/en/beats/filebeat/current/drop-event.html) with an [equals condition](https://www.elastic.co/guide/en/beats/filebeat/current/defining-processors.html#conditions) similar to `name: "PG3"`?

Let me know if there's a specific reason why you need a JavaScript processor, or have questions about the above approach.
