# Simple ruby filter failing

**URL:** https://discuss.elastic.co/t/simple-ruby-filter-failing/121711
**Category:** Logstash
**Created:** [February 27, 2018, 5:51pm UTC](https://discuss.elastic.co/t/simple-ruby-filter-failing/121711 "2018-02-27T17:51:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![awynham](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@awynham](https://discuss.elastic.co/u/awynham)
#### Post date: [February 27, 2018, 5:51pm UTC](https://discuss.elastic.co/t/simple-ruby-filter-failing/121711/1 "2018-02-27T17:51:42Z")

</div>

I kept running into a wall trying to get a ruby file to work for a filter and I finally simplified my config file to simply this:

```
filter {
    ruby {
        code => "event.cancel"
    }
}

```

But even with this simple example, running logstash.bat -t gives me the following:

> The given configuration is invalid. Reason: uninitialized constant LogStashCompilerLSCLGrammar::LogStash::Compiler::LSCL::AST:#️⃣:ConfigurationError

Can anyone point me in the right direction to get a ruby filter to work at all?

---

<div class="post-metadata">

### Author: ![awynham](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@awynham](https://discuss.elastic.co/u/awynham)
#### Post date: [February 27, 2018, 10:36pm UTC](https://discuss.elastic.co/t/simple-ruby-filter-failing/121711/2 "2018-02-27T22:36:59Z")

</div>

Found issue elsewhere. Made multiple changes at once and was chasing a red herring.

---

<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: [March 27, 2018, 10:37pm UTC](https://discuss.elastic.co/t/simple-ruby-filter-failing/121711/3 "2018-03-27T22:37:23Z")

</div>

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