# Logstash test with rspec

**URL:** <https://discuss.elastic.co/t/logstash-test-with-rspec/41478>\
**Category:** Logstash\
**Created:** [February 11, 2016, 11:46am UTC](https://discuss.elastic.co/t/logstash-test-with-rspec/41478 "2016-02-11T11:46:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sabbasth](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sabbasth/32/4627_2.png) [@Sabbasth](https://discuss.elastic.co/u/Sabbasth)\
**Post date:** [February 11, 2016, 11:46am UTC](https://discuss.elastic.co/t/logstash-test-with-rspec/41478/1 "2016-02-11T11:46:11Z")

</div>

Hi,

I have issues getting fields set during filtering with rspec.  
I created a post on stackoverflow:

> <https://stackoverflow.com/questions/35335445/logstash-grok-test-with-rspec-has-a-different-behavior>

Any clue on this strange behavior ?

---

<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:** [February 12, 2016, 8:20am UTC](https://discuss.elastic.co/t/logstash-test-with-rspec/41478/2 "2016-02-12T08:20:27Z")

</div>

I'm afraid I can't help with your RSpec woes, but for testing Logstash filter configurations I think you'll find [https://github.com/magnusbaeck/logstash-filter-verifier](https://github.com/magnusbaeck/logstash-filter-verifier) easier to use than writing RSpec tests (full disclosure: I am the author of said tool). It's basically an automation wrapper around the Logstash command that you ran to verify your filter.

---

<div class="post-metadata">

**Author:** ![wiibaa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wiibaa/32/44931_2.png) [@wiibaa](https://discuss.elastic.co/u/wiibaa)\
**Post date:** [February 12, 2016, 11:07am UTC](https://discuss.elastic.co/t/logstash-test-with-rspec/41478/3 "2016-02-12T11:07:43Z")

</div>

Hi,

Since the explosion to multiple gems, testing grok requires specific config to load the patterns, correctly, the codebase just changed today to fix a related issue: [https://github.com/logstash-plugins/logstash-filter-grok/pull/73/files](https://github.com/logstash-plugins/logstash-filter-grok/pull/73/files)

I suppose it could be used from your own spec

@magnusbaeck that's a nice tool I did not know about

---

<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 6, 2017, 5:11am UTC](https://discuss.elastic.co/t/logstash-test-with-rspec/41478/4 "2017-07-06T05:11:49Z")

</div>


