# \[Resolved\] Logstash Custom Plugin - Unable to create session to Neo4j within Logstash

**URL:** <https://discuss.elastic.co/t/resolved-logstash-custom-plugin-unable-to-create-session-to-neo4j-within-logstash/37890>\
**Category:** Logstash\
**Created:** [December 23, 2015, 9:51pm UTC](https://discuss.elastic.co/t/resolved-logstash-custom-plugin-unable-to-create-session-to-neo4j-within-logstash/37890 "2015-12-23T21:51:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thehybridtech](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@thehybridtech](https://discuss.elastic.co/u/thehybridtech)\
**Post date:** [December 23, 2015, 9:51pm UTC](https://discuss.elastic.co/t/resolved-logstash-custom-plugin-unable-to-create-session-to-neo4j-within-logstash/37890/1 "2015-12-23T21:51:58Z")

</div>

I am having issues with a custom plugin and not exactly where to turn.

I am building a custom Logstash output plugin to build our Neo4j models. Running the code externally with jruby included with Logstash, I have no issues creating a session to our server. If run as a plugin, I end up with an undefined method error.  
`undefined method graph_db' for #<Neo4j::Server::CypherSession:0x3922b0a5>`

> **[The error reported is: undefined method \`graph\_db' for #](https://pastebin.com/kV5rHxpF)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

/opt/logstash/bin/logstash version  
logstash 2.1.1

Neo4j Community Version 2.3.1

Gems (Tested with earlier versions with similar behavior  
neo4j - 6.0.4  
neo4j-community - 2.2.4.1

I can generate the error with the below code.

> require "logstash/outputs/base"  
> require "logstash/namespace"  
> require 'neo4j'

> class LogStash::Outputs::neo4jGraph \< LogStash::Outputs::Base  
> config\_name "neo4jgraph"  
> def register  
> @session = Neo4j::Session.open(:server\_db,"[http://localhost:7474](http://localhost:7474)", basic\_auth: { username: "_ **", password: "** _" })  
> end

> def receive(event)  
> end  
> end

Any ideas or direction I can look?

Thank you!

---

<div class="post-metadata">

**Author:** ![thehybridtech](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@thehybridtech](https://discuss.elastic.co/u/thehybridtech)\
**Post date:** [December 24, 2015, 4:25am UTC](https://discuss.elastic.co/t/resolved-logstash-custom-plugin-unable-to-create-session-to-neo4j-within-logstash/37890/2 "2015-12-24T04:25:12Z")

</div>

This is solved. It happens that even though I was specifying server\_db, neo4jrb assumed because I was using jruby that I meant embedded\_db.

By setting the environment variable `WITHOUT_NEO4J_EMBEDDED` to `TRUE`, I am able to establish the session.

---

<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:17am UTC](https://discuss.elastic.co/t/resolved-logstash-custom-plugin-unable-to-create-session-to-neo4j-within-logstash/37890/3 "2017-07-06T05:17:23Z")

</div>


