Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fields are nil or empty #51

Open
becker-IT opened this issue Sep 7, 2015 · 2 comments
Open

Some fields are nil or empty #51

becker-IT opened this issue Sep 7, 2015 · 2 comments

Comments

@becker-IT
Copy link

Hello,

I got this line in the database

mandant = 24 
reference = 408
von_datum = 01.01.15    
bis_datum = 01.01.15    
...
SCHLUESSELWERT_1 = LAS_SND_REP
ID = 716785

And this is the result

/opt/logstash/bin/logstash -f jdbc.conf
Logstash startup completed
{
             "mandant" => 24.0,
            "referenz" => 408.0,
           "von_datum" => 2015-01-01 00:00:00 +0100,
           "bis_datum" => 2015-01-01 00:00:00 +0100,
    "ermittlungsdatum" => 2015-01-01 00:11:26 +0100,
               "monat" => 1.0,
                "jahr" => 2015.0,
                "wert" => 10.0,
    "schluesselwert_1" => "",
    "schluesselwert_2" => nil,
    "schluesselwert_3" => nil,
    "schluesselwert_4" => "",
    "schluesselwert_5" => nil,
           "bemerkung" => nil,
    "schluesselwert_6" => nil,
                  "id" => 716785.0,
            "@version" => "1",
          "@timestamp" => "2015-09-07T15:30:00.640Z"
}

The most important problem is that schluesselwert_1 is nil or empty and it's definitly filled in the database. The second problem is that for instance mandant is a normal integer instead of a float.

I tried ojdbc6 and ojdbc7.jar. This is my jdbc.conf

input {
  jdbc {
    jdbc_driver_library => "/opt/ojdbc6.jar"
    jdbc_driver_class => "Java::oracle.jdbc.OracleDriver"
    jdbc_connection_string => "jdbc:oracle:thin:@//db:1521/db"
    jdbc_user => "MGMT"
    jdbc_password => "pw"
    schedule => "* * * * *"

    statement => "select * from OPM where ID='716785'"
  }
}

filter {
}

output {
    #if ("_grokparsefailure" in [tags]) {
        stdout { codec => rubydebug }
    #}
}

Thanks

@becker-IT
Copy link
Author

Interesting is that when I use sql function, such as "to_char" the the field becomes empty.
select to_char(MANDANT) mandant,

When I use this my mandant field becomes empty too. So I guess there is a problem with strings generally.

@ITSEC-Hescalona
Copy link

Use ojdbc14.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants