log_sense 1.3.5 → 1.5.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.org +46 -0
- data/Gemfile.lock +4 -4
- data/README.org +24 -10
- data/Rakefile +17 -3
- data/exe/log_sense +24 -16
- data/ip_locations/dbip-country-lite.sqlite3 +0 -0
- data/lib/log_sense/apache_data_cruncher.rb +30 -30
- data/lib/log_sense/apache_log_line_parser.rb +12 -13
- data/lib/log_sense/apache_log_parser.rb +44 -36
- data/lib/log_sense/emitter.rb +518 -15
- data/lib/log_sense/ip_locator.rb +26 -19
- data/lib/log_sense/options_parser.rb +35 -30
- data/lib/log_sense/rails_data_cruncher.rb +8 -4
- data/lib/log_sense/rails_log_parser.rb +108 -100
- data/lib/log_sense/templates/_command_invocation.html.erb +0 -4
- data/lib/log_sense/templates/_command_invocation.txt.erb +4 -3
- data/lib/log_sense/templates/_navigation.html.erb +21 -0
- data/lib/log_sense/templates/_output_table.html.erb +2 -7
- data/lib/log_sense/templates/_output_table.txt.erb +14 -0
- data/lib/log_sense/templates/_performance.html.erb +1 -1
- data/lib/log_sense/templates/_performance.txt.erb +8 -5
- data/lib/log_sense/templates/_report_data.html.erb +2 -2
- data/lib/log_sense/templates/_summary.html.erb +6 -1
- data/lib/log_sense/templates/_summary.txt.erb +11 -8
- data/lib/log_sense/templates/_warning.txt.erb +1 -0
- data/lib/log_sense/templates/apache.html.erb +14 -335
- data/lib/log_sense/templates/apache.txt.erb +22 -0
- data/lib/log_sense/templates/rails.html.erb +13 -174
- data/lib/log_sense/templates/rails.txt.erb +10 -60
- data/lib/log_sense/version.rb +1 -1
- metadata +6 -2
| @@ -1,72 +1,22 @@ | |
| 1 1 | 
             
            * Rails Log Analysis
         | 
| 2 2 |  | 
| 3 | 
            -
            <%= render " | 
| 4 | 
            -
             | 
| 5 | 
            -
            ** Access by Day
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            <%=
         | 
| 8 | 
            -
            table = Terminal::Table.new headings: ['Date', 'Day', 'Events'], rows: @data[:daily_distribution]
         | 
| 9 | 
            -
            table.align_column(3, :right)
         | 
| 10 | 
            -
            table
         | 
| 11 | 
            -
            %>
         | 
| 12 | 
            -
             | 
| 13 | 
            -
            ** Access by Time
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            <%=
         | 
| 16 | 
            -
            table = Terminal::Table.new headings: ['Hour', 'Events'], rows: @data[:time_distribution]
         | 
| 17 | 
            -
            table.align_column(2, :right)
         | 
| 18 | 
            -
            table
         | 
| 19 | 
            -
            %>
         | 
| 20 | 
            -
             | 
| 21 | 
            -
            ** Statuses
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            <%=
         | 
| 24 | 
            -
            table = Terminal::Table.new headings: ['Status', 'Events'], rows: @data[:statuses]
         | 
| 25 | 
            -
            table.align_column(2, :right)
         | 
| 26 | 
            -
            table
         | 
| 27 | 
            -
            %>
         | 
| 3 | 
            +
            <%= render "warning.txt.erb" %>
         | 
| 28 4 |  | 
| 29 | 
            -
            **  | 
| 5 | 
            +
            ** Summary
         | 
| 30 6 |  | 
| 31 | 
            -
            <%=  | 
| 32 | 
            -
            table.align_column(1, :right)
         | 
| 33 | 
            -
            table.align_column(2, :right)
         | 
| 34 | 
            -
            table.align_column(3, :right)
         | 
| 35 | 
            -
            table.align_column(4, :right)
         | 
| 36 | 
            -
            table
         | 
| 37 | 
            -
            %>
         | 
| 38 | 
            -
             | 
| 39 | 
            -
            ** Fatal Events
         | 
| 40 | 
            -
             | 
| 41 | 
            -
            <%= table = Terminal::Table.new headings: ['Date', 'IP', 'URL', 'Description', 'Log ID'], rows: @data[:fatal]
         | 
| 42 | 
            -
            table
         | 
| 43 | 
            -
            %>
         | 
| 44 | 
            -
             | 
| 45 | 
            -
            ** Internal Server Errors
         | 
| 46 | 
            -
             | 
| 47 | 
            -
            <%= table = Terminal::Table.new headings: ['Date', 'Status', 'IP', 'URL', 'Description', 'Log ID'], rows: @data[:internal_server_error]
         | 
| 48 | 
            -
            table
         | 
| 49 | 
            -
            %>
         | 
| 50 | 
            -
             | 
| 51 | 
            -
            ** Errors
         | 
| 52 | 
            -
             | 
| 53 | 
            -
            <%= table = Terminal::Table.new headings: ['Log ID', 'Context', 'Description', 'Count'], rows: @data[:error]
         | 
| 54 | 
            -
            table
         | 
| 55 | 
            -
            %>
         | 
| 7 | 
            +
            <%= render "summary.txt.erb", data: data %>
         | 
| 56 8 |  | 
| 57 | 
            -
             | 
| 9 | 
            +
            <% @reports.reject { |x| x[:report] == :html }.each do |report| %>
         | 
| 10 | 
            +
            ** <%= report[:title] %>
         | 
| 58 11 |  | 
| 59 | 
            -
            <%=
         | 
| 60 | 
            -
             | 
| 61 | 
            -
            table.align_column(1, :right)
         | 
| 62 | 
            -
            table
         | 
| 63 | 
            -
            %>
         | 
| 12 | 
            +
            <%= render "output_table.txt.erb", report: report, data: data %>
         | 
| 13 | 
            +
            <% end %>
         | 
| 64 14 |  | 
| 65 15 | 
             
            ** Command Invocation
         | 
| 66 16 |  | 
| 67 | 
            -
            <%= render  | 
| 17 | 
            +
            <%= render 'command_invocation.txt.erb', data: data %>
         | 
| 68 18 |  | 
| 69 | 
            -
            **  | 
| 19 | 
            +
            ** Performance
         | 
| 70 20 |  | 
| 71 | 
            -
            <%= render  | 
| 21 | 
            +
            <%= render 'performance.txt.erb', data: data %>
         | 
| 72 22 |  | 
    
        data/lib/log_sense/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: log_sense
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.5.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Adolfo Fibrillation
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022- | 
| 11 | 
            +
            date: 2022-03-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: browser
         | 
| @@ -141,13 +141,17 @@ files: | |
| 141 141 | 
             
            - lib/log_sense/templates/_command_invocation.html.erb
         | 
| 142 142 | 
             
            - lib/log_sense/templates/_command_invocation.txt.erb
         | 
| 143 143 | 
             
            - lib/log_sense/templates/_log_structure.html.erb
         | 
| 144 | 
            +
            - lib/log_sense/templates/_navigation.html.erb
         | 
| 144 145 | 
             
            - lib/log_sense/templates/_output_table.html.erb
         | 
| 146 | 
            +
            - lib/log_sense/templates/_output_table.txt.erb
         | 
| 145 147 | 
             
            - lib/log_sense/templates/_performance.html.erb
         | 
| 146 148 | 
             
            - lib/log_sense/templates/_performance.txt.erb
         | 
| 147 149 | 
             
            - lib/log_sense/templates/_report_data.html.erb
         | 
| 148 150 | 
             
            - lib/log_sense/templates/_summary.html.erb
         | 
| 149 151 | 
             
            - lib/log_sense/templates/_summary.txt.erb
         | 
| 152 | 
            +
            - lib/log_sense/templates/_warning.txt.erb
         | 
| 150 153 | 
             
            - lib/log_sense/templates/apache.html.erb
         | 
| 154 | 
            +
            - lib/log_sense/templates/apache.txt.erb
         | 
| 151 155 | 
             
            - lib/log_sense/templates/rails.html.erb
         | 
| 152 156 | 
             
            - lib/log_sense/templates/rails.txt.erb
         | 
| 153 157 | 
             
            - lib/log_sense/version.rb
         |