Giter Site home page Giter Site logo

Comments (7)

theangryangel avatar theangryangel commented on June 10, 2024

In theory, I don't see why not, although I've not tested it.

Something like the following will probably work. Example assumes procedure_name is in the default schema (dbo) and has 3 parameters, which host, timestamp and message is passed to it. None of which are optional.

jdbc {
    connection_string => "jdbc:sqlserver://server:1433;databaseName=databasename;user=username;password=password"
    statement => [ "exec dbo.procedure_name ?, ?, ?", "host", "@timestamp", "message" ]
}

If you can try it out and let me know if it works, that would be great.

If it doesn't work do let me know, and I'll power up a test machine to try a few things out. Probably won't be until later in the weekend though.

from logstash-output-jdbc.

starlessboi avatar starlessboi commented on June 10, 2024

sorry for delay
I followed your sample. it's working
Thanks for your time

from logstash-output-jdbc.

theangryangel avatar theangryangel commented on June 10, 2024

Thanks @starlessboi - much appreciated 👍

from logstash-output-jdbc.

DGessinger avatar DGessinger commented on June 10, 2024

Hi guys,
could you please post your stored procedure used in this example?
Thanks a lot

from logstash-output-jdbc.

theangryangel avatar theangryangel commented on June 10, 2024

It was just a test procedure that inserted some data into a table. It probably wasn't anything fancier than the following... (bear in mind I've written this as T-SQL. The syntax for your database may be different...)

CREATE PROCEDURE dbo.procedure_name @hostname varchar(512), @timestamp datetime, @message varchar(max)
AS  
  insert into dbo.log (hostname, timestamp, message) values(@hostname, @timestamp, @message)
GO  

from logstash-output-jdbc.

Chandrapraba15 avatar Chandrapraba15 commented on June 10, 2024

Hi, How to wire the oracle stored procedures which return ref cursor?

from logstash-output-jdbc.

theangryangel avatar theangryangel commented on June 10, 2024

Logstash does not permit output plugins to return new data. If you want to do something with the data returned from an output plugin you're gonna have to write a custom plugin. If you're mistaking this for the jdbc input plugin, this is completely unrelated and you need to raise it at https://github.com/logstash-plugins/logstash-input-jdbc

from logstash-output-jdbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.