# Logstash configuration file unit testing

**URL:** <https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450>\
**Category:** Logstash\
**Created:** [June 6, 2017, 5:28pm UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450 "2017-06-06T17:28:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nileshgattani](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nileshgattani](https://discuss.elastic.co/u/nileshgattani)\
**Post date:** [June 6, 2017, 5:28pm UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450/1 "2017-06-06T17:28:55Z")

</div>

Hi there,

Are there any general guidelines on how to go about unit testing logstash config files? I did some research and picked on a few examples, but they all are very old and don't seem to be compatible with logstash 5.4.0 .

Also, is it possible to write unit tests in programming languages other than ruby , like java?

Thanks  
-Nilesh

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 7, 2017, 9:48am UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450/2 "2017-06-07T09:48:04Z")

</div>

I recommend a tool that I've written, [Logstash Filter Verifier](https://github.com/magnusbaeck/logstash-filter-verifier). It's currently not compatible with Logstash 5.x but I hope I can sort that out in the next few weeks. Depending on your filters you may be able to test your configuration files with Logstash 2.4 instead.

---

<div class="post-metadata">

**Author:** ![nileshgattani](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nileshgattani](https://discuss.elastic.co/u/nileshgattani)\
**Post date:** [June 7, 2017, 3:50pm UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450/3 "2017-06-07T15:50:39Z")

</div>

Thanks Magnus, using logstash-2.4 is not an option right now, so I need something that works with 5.4.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 7, 2017, 7:40pm UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450/4 "2017-06-07T19:40:09Z")

</div>

I actually think it works with 5.x as long as you're pointing it to the Logstash binary of an unpacked tarball rather than a Logstash installed via a Debian package or RPM.

---

<div class="post-metadata">

**Author:** ![nileshgattani](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nileshgattani](https://discuss.elastic.co/u/nileshgattani)\
**Post date:** [June 7, 2017, 8:53pm UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450/5 "2017-06-07T20:53:26Z")

</div>

I am actually using the log stash tarball. I will give it a shot and let you know how it goes.

Thanks for your help  
-Nilesh

---

<div class="post-metadata">

**Author:** ![nileshgattani](https://avatars.discourse-cdn.com/v4/letter/n/4491bb/32.png) [@nileshgattani](https://discuss.elastic.co/u/nileshgattani)\
**Post date:** [June 12, 2017, 3:52pm UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450/6 "2017-06-12T15:52:07Z")

</div>

Hi Magnus,

Logstash filter verifier worked like a charm. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 10, 2017, 3:52pm UTC](https://discuss.elastic.co/t/logstash-configuration-file-unit-testing/88450/7 "2017-07-10T15:52:18Z")

</div>

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