logstash-lite 0.2.20101118141920 → 0.2.20101119183130

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,11 +21,11 @@ class LogStash::Inputs::File < LogStash::Inputs::Base
21
21
  url.path = filetail.path
22
22
  @logger.debug(["original url", { :originalurl => @url, :newurl => url }])
23
23
  event = LogStash::Event.new({
24
- "@source" => url,
25
24
  "@message" => event,
26
25
  "@type" => @type,
27
26
  "@tags" => @tags.clone,
28
27
  })
28
+ event.source = url
29
29
  @logger.debug(["Got event", event])
30
30
  @callback.call(event)
31
31
  end # def receive
@@ -24,11 +24,11 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base
24
24
  url.port = port
25
25
  @logger.debug(["original url", { :originalurl => @url, :newurl => url }])
26
26
  event = LogStash::Event.new({
27
- "@source" => url,
28
27
  "@message" => event,
29
28
  "@type" => @type,
30
29
  "@tags" => @tags.clone,
31
30
  })
31
+ event.source = url
32
32
  @logger.debug(["Got event", event])
33
33
  @callback.call(event)
34
34
  end # def receive
@@ -22,14 +22,13 @@ class LogStash::Outputs::Gelf < LogStash::Outputs::Base
22
22
  gelf.short_message = (event.fields["message"] or event.message)
23
23
  gelf.full_message = (event.message)
24
24
  gelf.level = 1
25
- source = URI.parse(event.source)
26
- gelf.host = source.host
27
- gelf.file = source.path
25
+ gelf.host = event["@source_host"]
26
+ gelf.file = event["@source_path"]
28
27
 
29
28
  event.fields.each do |name, value|
30
29
  gelf.add_additional name, value
31
30
  end
32
- gelf.add_additional "@timestamp", event.timestamp
31
+ gelf.add_additional "event_timestamp", event.timestamp
33
32
  gelf.send
34
33
  end # def event
35
34
  end # class LogStash::Outputs::Gelf
@@ -104,9 +104,11 @@
104
104
  return false;
105
105
  });
106
106
 
107
- $("ul.results li.event").live("click", function() {
108
- var data = eval($(this).data("full"));
107
+ var result_row_selector = "table.results tr.event";
108
+ $(result_row_selector).live("click", function() {
109
+ var data = eval($("td.message", this).data("full"));
109
110
 
111
+ console.log(event);
110
112
  /* Apply template to the dialog */
111
113
  var query = $("#query").val().replace(/^\s+|\s+$/g, "")
112
114
  var sanitize = function(str) {
@@ -161,7 +163,7 @@
161
163
  return 0;
162
164
  });
163
165
 
164
- $("ul.results li.selected").removeClass("selected")
166
+ $(result_row_selector).removeClass("selected")
165
167
  $(this).addClass("selected");
166
168
  var entry = this;
167
169
  $("#inspector li").remove()
@@ -22,11 +22,17 @@
22
22
  - if @next_href
23
23
  %a.pager{ :href => @next_href }
24
24
  next
25
- %ul.results
26
- - @hits.reverse.each do |hit|
27
- %li.event{ :"data-full" => hit.to_json }&= hit["_source"]["@message"]
28
- - if @hits.length == 0
29
- - if !params[:q]
30
- No query given. How about <a href="?q=*" class="querychanger">this?</a>
31
- - else
32
- No results for query '#{params[:q]}'
25
+ - if @hits.length == 0
26
+ - if !params[:q]
27
+ No query given. How about <a href="?q=*" class="querychanger">this?</a>
28
+ - else
29
+ No results for query '#{params[:q]}'
30
+ - else
31
+ %table.results
32
+ %tr
33
+ %th timestamp
34
+ %th event
35
+ - @hits.reverse.each do |hit|
36
+ %tr.event
37
+ %td.timestamp&= hit["_source"]["@timestamp"]
38
+ %td.message{ :"data-full" => hit.to_json }&= hit["_source"]["@message"]
@@ -20,18 +20,22 @@ body
20
20
  margin-left: 2em
21
21
  margin-right: 2em
22
22
  margin-top: 1em
23
- #content ul.results
23
+ #content table.results
24
24
  font-family: monospace
25
- #content li.event
25
+ #content td.event
26
26
  padding-bottom: 3px
27
27
  white-space: pre-wrap
28
- #content li.selected
28
+ #content td.timestamp
29
+ white-space: nowrap
30
+ font-size: 85%
31
+ text-align: top
32
+ #content tr.selected
29
33
  background-color: #FCE69D !important
30
- #content li.event:nth-child(2n)
34
+ #content tr.event:nth-child(2n)
31
35
  background-color: #E3F6CE
32
- #content li.event:nth-child(2n+1)
36
+ #content tr.event:nth-child(2n+1)
33
37
  background-color: #F5FBEF
34
- #content li.event:hover
38
+ #content tr.event:hover
35
39
  background-color: lightgreen
36
40
  #error
37
41
  background-color: pink
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-lite
3
3
  version: !ruby/object:Gem::Version
4
- hash: 40202236283863
4
+ hash: 40202238366243
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 20101118141920
10
- version: 0.2.20101118141920
9
+ - 20101119183130
10
+ version: 0.2.20101119183130
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-18 00:00:00 -08:00
18
+ date: 2010-11-19 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency