# Logstash accessing DB2 on z/OS; classpath, license issues?

**URL:** <https://discuss.elastic.co/t/logstash-accessing-db2-on-z-os-classpath-license-issues/39042>\
**Category:** Logstash\
**Created:** [January 13, 2016, 12:18am UTC](https://discuss.elastic.co/t/logstash-accessing-db2-on-z-os-classpath-license-issues/39042 "2016-01-13T00:18:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Russ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russ/32/5821_2.png) [@Russ](https://discuss.elastic.co/u/Russ)\
**Post date:** [January 13, 2016, 12:18am UTC](https://discuss.elastic.co/t/logstash-accessing-db2-on-z-os-classpath-license-issues/39042/1 "2016-01-13T00:18:25Z")

</div>

Has anyone setup Logstash to extract data from DB2 on z/OS? I had it working about four weeks ago, but after the holidays, something had changed so that I was getting this error related to the .jar / license files.

The error reported is:  
Java::ComIbmDb2JccAm::SqlSyntaxErrorException: [jcc][t4][10509][13454][4.16.53] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid  
or was not activated for the DB2 for z/OS subsystem. If you are connecting directly to  
the data server and using DB2 Connect Unlimited Edition for System z, perform the  
activation step by running the activation program in the license activation kit.  
If you are using any other edition of DB2 Connect, obtain the license file,  
db2jcc\_license\_cisuz.jar, from the license activation kit, and follow the installation  
directions to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968

I have logstash installed in /opt/logstash and my config file is using:  
jdbc\_driver\_library =\> "/opt/IBM/db2jcc4.jar"  
jdbc\_driver\_class =\> "com.ibm.db2.jcc.DB2Driver"

To cover my bases, I have placed these .jar files in both /opt/IBM/ as well as /opt/logstash/  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/a1386fdb393631a45af7229d0c79c637e2b97395.png)

Is the possible problem that Logstash isn't finding these .jar files? Or, something more tied to the DB2 JDBC driver and license for z/OS?

---

<div class="post-metadata">

**Author:** ![Russ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russ/32/5821_2.png) [@Russ](https://discuss.elastic.co/u/Russ)\
**Post date:** [January 14, 2016, 3:36pm UTC](https://discuss.elastic.co/t/logstash-accessing-db2-on-z-os-classpath-license-issues/39042/2 "2016-01-14T15:36:45Z")

</div>

Good news -- I sorted out the error message, finally! Hopefully by documenting this, it will help someone else out who encounters the same error!

I ended up biting the bullet and installing DB2 Connect for Linux, and as a result, received a new set of JDBC / DB2 jar files that I pointed Logstash to. CLASSPATH=.:/opt/ibm/db2/V10.1/java/\*

 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/27ad90375c956db69dfd65c418d37a4b6f7a461c.png)

This did the trick, as I'm now able to connect Logstash to DB2 on z/OS, iSeries, and AIX. From what I can tell, installing DB2 Connect may have activated the license jar file, but I'm not sure.

For future reference, I was able to debug a little better when I started calling the JDBC / DB2 driver directly from the command line.

db2jcc -url jdbc:db2://:/ -user -password \*\*\*\*\*\*\*\*  
java -cp ./db2jcc4.jar com.ibm.db2.jcc.DB2Jcc -url jdbc:db2://:/ -user -password \*\*\*\*\*\*\*\*

---

<div class="post-metadata">

**Author:** ![elvarb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elvarb/32/44840_2.png) [@elvarb](https://discuss.elastic.co/u/elvarb)\
**Post date:** [January 16, 2016, 1:54pm UTC](https://discuss.elastic.co/t/logstash-accessing-db2-on-z-os-classpath-license-issues/39042/3 "2016-01-16T13:54:31Z")

</div>

I believe that it should be enough to add the .lic file to the place where you have the db2 jdbc files. Worth trying.

---

<div class="post-metadata">

**Author:** ![OVS](https://avatars.discourse-cdn.com/v4/letter/o/35a633/32.png) [@OVS](https://discuss.elastic.co/u/OVS)\
**Post date:** [May 25, 2016, 8:40am UTC](https://discuss.elastic.co/t/logstash-accessing-db2-on-z-os-classpath-license-issues/39042/4 "2016-05-25T08:40:37Z")

</div>

HI Russ  
I'm trying to startup logstash on z/os to collect data from DB2 .  
But i don't now which logstash scrips may i use.  
Which logstash did you use??

---

<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, 4:56am UTC](https://discuss.elastic.co/t/logstash-accessing-db2-on-z-os-classpath-license-issues/39042/5 "2017-07-06T04:56:21Z")

</div>


