logstash-filter-varnishlog 0.1.9 → 0.2.0
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 +4 -4
- data/CHANGELOG.md +2 -0
- data/lib/logstash/filters/varnishlog.rb +9 -9
- data/logstash-filter-varnishlog.gemspec +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2e70f08b94d6fa83c9151078e5c806b796418a4b
         | 
| 4 | 
            +
              data.tar.gz: 9aed70b3bff1a9ab3518ef526d03067b343d8268
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 82a1140cf06a4906c5f554f4e241c4ced35333c909c47eb66f17c2cf44867dac26fbbd640ff541f9accb8819fba48edfd9d2073242831b06befa72d3e81ce7a7
         | 
| 7 | 
            +
              data.tar.gz: 818cf06c1a7d2508014ecff6cca6c4d72918dce3d6e0c9d8f8bd2a96ec04f7eb4b27e0c4b75779bb9333ea79adbd8cd2ac3d1b8c024a14316597fb1b0053f126
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
| @@ -49,7 +49,7 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base | |
| 49 49 | 
             
                ##timestamps
         | 
| 50 50 | 
             
                timestamps = items.grep(/Timestamp/)
         | 
| 51 51 | 
             
                timestamps.each do |timestamp|
         | 
| 52 | 
            -
                  if match = /-\s+Timestamp\s+(?<step | 
| 52 | 
            +
                  if match = /-\s+Timestamp\s+(?<step>.+): (?<time_a>.*) (?<time_b>.+) (?<time_c>.+)/.match(timestamp)
         | 
| 53 53 | 
             
                    event.set(normalize_fields("timestamp_" + match['step'] ), match['time_a'])
         | 
| 54 54 | 
             
                    event.set(normalize_fields("timestamp_" + match['step'] + "_raw"), match['time_a'] + " " + match['time_b'] + " " + match['time_c'])
         | 
| 55 55 | 
             
                  end
         | 
| @@ -66,7 +66,7 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base | |
| 66 66 | 
             
                vcl_log = items.grep(/VCL_Log/)
         | 
| 67 67 | 
             
                log_lines = []
         | 
| 68 68 | 
             
                vcl_log.each_with_index do |log, index|
         | 
| 69 | 
            -
                  if match = /-\s+VCL_Log\s+(?<log_line | 
| 69 | 
            +
                  if match = /-\s+VCL_Log\s+(?<log_line>.+)/.match(log)
         | 
| 70 70 | 
             
                    log_lines.push(match['log_line'])
         | 
| 71 71 | 
             
                  end
         | 
| 72 72 | 
             
                  if index == log_lines.size - 1
         | 
| @@ -78,31 +78,31 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base | |
| 78 78 | 
             
                ## Request headers.
         | 
| 79 79 | 
             
                request_headers = items.grep(/(Be)?([rR]eq|[rR]esp)Header/)
         | 
| 80 80 | 
             
                request_headers.each do |header|
         | 
| 81 | 
            -
                  if match = /-+\s+(Be)?([rR]eq|[rR]esp)Header\s+(?<header_name | 
| 81 | 
            +
                  if match = /-+\s+(Be)?([rR]eq|[rR]esp)Header\s+(?<header_name>.+): (?<header_value>.*)/.match(header)
         | 
| 82 82 | 
             
                    event.set(normalize_fields(match['header_name']), match['header_value'])
         | 
| 83 83 | 
             
                  end
         | 
| 84 84 | 
             
                end
         | 
| 85 85 | 
             
                ## Match ReqMethod.
         | 
| 86 | 
            -
                if method_match = /-+\s+(Be)?([rR]eq|[rR]esp)Method\s+(?<method | 
| 86 | 
            +
                if method_match = /-+\s+(Be)?([rR]eq|[rR]esp)Method\s+(?<method>.+)/.match(items.grep(/(Be)?([rR]eq|[rR]esp)Method/)[0])
         | 
| 87 87 | 
             
                  event.set("http_method", method_match['method'])
         | 
| 88 88 | 
             
                end
         | 
| 89 89 | 
             
                ## Match ReqURL.
         | 
| 90 | 
            -
                if url_match = /-+\s+(Be)?([rR]eq|[rR]esp)URL\s+(?<url | 
| 90 | 
            +
                if url_match = /-+\s+(Be)?([rR]eq|[rR]esp)URL\s+(?<url>\/.+)/.match(items.grep(/(Be)?([rR]eq|[rR]esp)URL/)[0])
         | 
| 91 91 | 
             
                  event.set("url", url_match['url'])
         | 
| 92 92 | 
             
                end
         | 
| 93 93 | 
             
                ## Match ReqProtocol.
         | 
| 94 | 
            -
                if protocol_match = /-+\s+(Be)?([rR]eq|[rR]esp)Protocol\s+(?<protocol | 
| 94 | 
            +
                if protocol_match = /-+\s+(Be)?([rR]eq|[rR]esp)Protocol\s+(?<protocol>.+)/.match(items.grep(/(Be)?([rR]eq|[rR]esp)Protocol/)[0])
         | 
| 95 95 | 
             
                  event.set("protocol", protocol_match['protocol'])
         | 
| 96 96 | 
             
                end
         | 
| 97 97 | 
             
                ## FetchError.
         | 
| 98 | 
            -
                if error_match = /-+\s+FetchError\s+(?<error | 
| 98 | 
            +
                if error_match = /-+\s+FetchError\s+(?<error>.+)/.match(items.grep(/FetchError/)[0])
         | 
| 99 99 | 
             
                  event.set("FetchError", error_match['error'])
         | 
| 100 100 | 
             
                end
         | 
| 101 101 | 
             
                ## Match RespStatus
         | 
| 102 102 | 
             
                status_match = items.grep(/(Be)?([rR]eq|[rR]esp)Status/)
         | 
| 103 103 | 
             
                states = []
         | 
| 104 104 | 
             
                status_match.each_with_index do |status, index|
         | 
| 105 | 
            -
                  if match = /-+\s+(Be)?([rR]eq|[rR]esp)Status\s+(?<status | 
| 105 | 
            +
                  if match = /-+\s+(Be)?([rR]eq|[rR]esp)Status\s+(?<status>.+)/.match(status)
         | 
| 106 106 | 
             
                    states.push(match['status'].to_i)
         | 
| 107 107 | 
             
                  end
         | 
| 108 108 | 
             
                  if index == status_match.size - 1
         | 
| @@ -113,7 +113,7 @@ class LogStash::Filters::Varnishlog < LogStash::Filters::Base | |
| 113 113 | 
             
                response_reason = items.grep(/(Be)?([rR]eq|[rR]esp)Reason/)
         | 
| 114 114 | 
             
                reasons = []
         | 
| 115 115 | 
             
                response_reason.each_with_index do |reason, index|
         | 
| 116 | 
            -
                  if match = /-+\s+(Be)?([rR]eq|[rR]esp)Reason\s+(?<reason | 
| 116 | 
            +
                  if match = /-+\s+(Be)?([rR]eq|[rR]esp)Reason\s+(?<reason>.+)/.match(reason)
         | 
| 117 117 | 
             
                    reasons.push(match['reason'])
         | 
| 118 118 | 
             
                  end
         | 
| 119 119 | 
             
                  if index == response_reason.size - 1
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            Gem::Specification.new do |s|
         | 
| 2 2 | 
             
              s.name          = 'logstash-filter-varnishlog'
         | 
| 3 | 
            -
              s.version       = '0. | 
| 3 | 
            +
              s.version       = '0.2.0'
         | 
| 4 4 | 
             
              s.licenses      = ['Apache License (2.0)']
         | 
| 5 5 | 
             
              s.summary       = 'A logstash plugin reading varnishlog output'
         | 
| 6 6 | 
             
              s.description   = 'logstash filter plugin reading varnishlog grouped by id'
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: logstash-filter-varnishlog
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Christian Herweg
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018-05- | 
| 11 | 
            +
            date: 2018-05-03 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              requirement: !ruby/object:Gem::Requirement
         |