logstash-lite 0.2.20101120021802 → 0.2.20101120024757

Sign up to get free protection for your applications and to get access to all the features.
@@ -79,10 +79,12 @@ module LogStash; class Event
79
79
 
80
80
  # Append all fields
81
81
  event.fields.each do |name, value|
82
- if event.fields.include?(name)
83
- event.fields[name] |= value
82
+ if self.fields.include?(name)
83
+ puts "Merging field #{name}"
84
+ self.fields[name] |= value
84
85
  else
85
- event.fields[name] = value
86
+ puts "Setting field #{name}"
87
+ self.fields[name] = value
86
88
  end
87
89
  end # event.fields.each
88
90
  end
@@ -46,6 +46,7 @@ class LogStash::Web::ElasticSearch
46
46
  data["duration"] = Time.now - start_time
47
47
 
48
48
  # TODO(sissel): Plugin-ify this (Search filters!)
49
+ # Search anonymization
49
50
  #require "digest/md5"
50
51
  #data["hits"]["hits"].each do |hit|
51
52
  [].each do |hit|
@@ -108,7 +108,6 @@
108
108
  $(result_row_selector).live("click", function() {
109
109
  var data = eval($("td.message", this).data("full"));
110
110
 
111
- console.log(event);
112
111
  /* Apply template to the dialog */
113
112
  var query = $("#query").val().replace(/^\s+|\s+$/g, "")
114
113
  var sanitize = function(str) {
@@ -121,10 +120,12 @@
121
120
  var template = $.template("inspector",
122
121
  "<li>" +
123
122
  "<b>(${type}) ${field}</b>:" +
124
- "<a href='/search?q=" + query + " ${escape(field)}:${$item.sanitize(value)}'" +
125
- " data-field='${escape(field)}' data-value='${$item.sanitize(value)}'>" +
126
- "${value}" +
127
- "</a>" +
123
+ "{{each(idx, val) value}}" +
124
+ "<a href='/search?q=" + query + " ${escape(field)}:${$item.sanitize(val)}'" +
125
+ " data-field='${escape(field)}' data-value='${$item.sanitize(val)}'>" +
126
+ "${val}" +
127
+ "</a>, " +
128
+ "{{/each}}" +
128
129
  "</li>");
129
130
 
130
131
  /* TODO(sissel): recurse through the data */
@@ -134,12 +135,19 @@
134
135
  if (/^[, ]*$/.test(value)) {
135
136
  continue; /* Skip empty data fields */
136
137
  }
138
+ if (!(value instanceof Array)) {
139
+ value = [value];
140
+ }
137
141
  fields.push( { type: "field", field: i, value: value })
138
142
  }
139
143
 
140
144
  for (var i in data._source) {
141
145
  if (i == "@fields") continue;
142
146
  var value = data._source[i]
147
+ if (!(value instanceof Array)) {
148
+ value = [value];
149
+ }
150
+
143
151
  if (i.charAt(0) == "@") { /* metadata */
144
152
  fields.push( { type: "metadata", field: i, value: value });
145
153
  } else { /* data */
@@ -154,7 +162,11 @@
154
162
  if (i == "_source") {
155
163
  continue; /* already processed this one */
156
164
  }
157
- fields.push( { type: "metadata", field: i, value: data[i] })
165
+ value = data[i]
166
+ if (!(value instanceof Array)) {
167
+ value = [value];
168
+ }
169
+ fields.push( { type: "metadata", field: i, value: value })
158
170
  }
159
171
 
160
172
  fields.sort(function(a, b) {
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: 40202240043587
4
+ hash: 40202240049533
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 20101120021802
10
- version: 0.2.20101120021802
9
+ - 20101120024757
10
+ version: 0.2.20101120024757
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Sissel