logstash-output-charrington 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 5bc7440fc12c2dee8a2c47f7c30c9f95cd11c7ecf6905ccefc5cbecf21e6588b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 409036adf2e56121fac87141d06686beda6d0d878bc7f1de1de14b58e58efd7b
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: d793f1abbf99da18b9076bb1c36d101bc52657694cdef5ef645c80dc39d16092eedbd28b423fc45285934514c2210ccfb1f1ca2288fe947d501c3a08d7b92a1e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 0500b6e35d903f450f29c3e521073486b5f523ffec9f3c89111610c65adf75e3b778050ca2340724dcbf03611dd07a57cac6f84bd796a50427bb1e8ee276919e
         
     | 
| 
         @@ -198,7 +198,7 @@ module Charrington 
     | 
|
| 
       198 
198 
     | 
    
         
             
                    when Float
         
     | 
| 
       199 
199 
     | 
    
         
             
                      stmt.setFloat(pos, value)
         
     | 
| 
       200 
200 
     | 
    
         
             
                    when String
         
     | 
| 
       201 
     | 
    
         
            -
                      stmt.setString(pos, value)
         
     | 
| 
      
 201 
     | 
    
         
            +
                      stmt.setString(pos, value[0,254]) # truncate at 254 string characters
         
     | 
| 
       202 
202 
     | 
    
         
             
                    when Array, Hash
         
     | 
| 
       203 
203 
     | 
    
         
             
                      stmt.setString(pos, value.to_json)
         
     | 
| 
       204 
204 
     | 
    
         
             
                    when true, false
         
     | 
| 
         @@ -4,12 +4,15 @@ describe LogStash::Outputs::Charrington do 
     | 
|
| 
       4 
4 
     | 
    
         
             
              include_context 'postgres'
         
     | 
| 
       5 
5 
     | 
    
         
             
              include_context 'pipeline'
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
     | 
    
         
            -
              describe 'a new payload with one event' do
         
     | 
| 
      
 7 
     | 
    
         
            +
              describe 'a new payload with one event that truncates strings correctly' do
         
     | 
| 
      
 8 
     | 
    
         
            +
                let(:too_big) do
         
     | 
| 
      
 9 
     | 
    
         
            +
                  "0123456789" * 30
         
     | 
| 
      
 10 
     | 
    
         
            +
                end
         
     | 
| 
       8 
11 
     | 
    
         
             
                let(:config) do
         
     | 
| 
       9 
12 
     | 
    
         
             
                  <<-CONFIG
         
     | 
| 
       10 
13 
     | 
    
         
             
                  input {
         
     | 
| 
       11 
14 
     | 
    
         
             
                    generator {
         
     | 
| 
       12 
     | 
    
         
            -
                      message => '{"app_name": "Web App", "event": "schemaless", "meta": { "type": "XML" }, "published_at": "2019-07-29T20:09:18Z" }'
         
     | 
| 
      
 15 
     | 
    
         
            +
                      message => '{"app_name": "Web App", "event": "schemaless", "meta": { "type": "XML", "too_big": "#{too_big}" }, "published_at": "2019-07-29T20:09:18Z" }'
         
     | 
| 
       13 
16 
     | 
    
         
             
                      codec => 'json'
         
     | 
| 
       14 
17 
     | 
    
         
             
                      count => 1
         
     | 
| 
       15 
18 
     | 
    
         
             
                    }
         
     | 
| 
         @@ -31,7 +34,7 @@ describe LogStash::Outputs::Charrington do 
     | 
|
| 
       31 
34 
     | 
    
         
             
                  create_tracks_table
         
     | 
| 
       32 
35 
     | 
    
         
             
                  drop_table('schemaless')
         
     | 
| 
       33 
36 
     | 
    
         
             
                  run_pipeline
         
     | 
| 
       34 
     | 
    
         
            -
                  expect(query('SELECT * FROM schemaless')).to match_array([{id: "1", app_name: "Web App", event: "schemaless", inserted_at: a_kind_of(String), :meta_type => "XML", :published_at => "2019-07-29 20:09:18"}])
         
     | 
| 
      
 37 
     | 
    
         
            +
                  expect(query('SELECT * FROM schemaless')).to match_array([{id: "1", app_name: "Web App", event: "schemaless", inserted_at: a_kind_of(String), :meta_type => "XML", :meta_too_big => too_big[0,254], :published_at => "2019-07-29 20:09:18"}])
         
     | 
| 
       35 
38 
     | 
    
         
             
                  expect(query('SELECT COUNT(1) FROM schemaless').first[:count]).to eq("1")
         
     | 
| 
       36 
39 
     | 
    
         
             
                end
         
     | 
| 
       37 
40 
     | 
    
         
             
              end
         
     | 
| 
         @@ -171,8 +174,8 @@ describe LogStash::Outputs::Charrington do 
     | 
|
| 
       171 
174 
     | 
    
         | 
| 
       172 
175 
     | 
    
         
             
                it 'creates a table and inserts the first record and alters the table for the second record' do
         
     | 
| 
       173 
176 
     | 
    
         
             
                  drop_table('tracks')
         
     | 
| 
       174 
     | 
    
         
            -
                  create_tracks_table('dea_test')
         
     | 
| 
       175 
177 
     | 
    
         
             
                  create("CREATE SCHEMA IF NOT EXISTS #{schema}")
         
     | 
| 
      
 178 
     | 
    
         
            +
                  create_tracks_table('dea_test')
         
     | 
| 
       176 
179 
     | 
    
         
             
                  drop_table("#{schema}.from_agent")
         
     | 
| 
       177 
180 
     | 
    
         
             
                  run_pipeline
         
     | 
| 
       178 
181 
     | 
    
         
             
                  expect(query("SELECT * FROM #{schema}.from_agent")).to match_array([
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: logstash-output-charrington
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.15
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - dconger
         
     | 
| 
         @@ -10,7 +10,7 @@ authors: 
     | 
|
| 
       10 
10 
     | 
    
         
             
            autorequire:
         
     | 
| 
       11 
11 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       12 
12 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       13 
     | 
    
         
            -
            date: 2019-07- 
     | 
| 
      
 13 
     | 
    
         
            +
            date: 2019-07-31 00:00:00.000000000 Z
         
     | 
| 
       14 
14 
     | 
    
         
             
            dependencies:
         
     | 
| 
       15 
15 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       16 
16 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     |