logstash-filter-webservicemap 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -2
- data/README.md +127 -0
- data/lib/logstash/filters/webservicemap.rb +2 -2
- data/logstash-filter-webservicemap.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: 10fd9f67f05a52b979eb155143b622dec3d1f3cf
|
4
|
+
data.tar.gz: 188a314dacdb1d29bbfef2dd99a1e8ebfd6f576f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02a774779ab2ffb34b72c501ee4837ba4da7dfaa1bbd57d3dacef6f8b8e630ea816f397ee47a73d39ce14acd08cdcb51081bc369693a959f81a9f2568f11f6f1
|
7
|
+
data.tar.gz: 05b6718bb4a04caeb11f75812020485171938ef1c06e7a7b232040d7aa0eb3f6f8f98b334786c85dc5a93cab3ed0cfb71a179352e7b0b57fcb088a567678f195
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
## 1.0.
|
2
|
-
-
|
1
|
+
## 1.0.1
|
2
|
+
- Minor fix to allow url's without a dot.
|
data/README.md
CHANGED
@@ -4,6 +4,133 @@ This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
|
4
4
|
|
5
5
|
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
6
6
|
|
7
|
+
## Example
|
8
|
+
### 1. Web Service Example
|
9
|
+
#### pom.xml
|
10
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
11
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
12
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
13
|
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
14
|
+
<modelVersion>4.0.0</modelVersion>
|
15
|
+
|
16
|
+
<groupId>es.nangel.logstash.webservicemap</groupId>
|
17
|
+
<artifactId>test</artifactId>
|
18
|
+
<version>1.0-SNAPSHOT</version>
|
19
|
+
|
20
|
+
<parent>
|
21
|
+
<groupId>org.springframework.boot</groupId>
|
22
|
+
<artifactId>spring-boot-starter-parent</artifactId>
|
23
|
+
<version>1.3.3.RELEASE</version>
|
24
|
+
</parent>
|
25
|
+
|
26
|
+
<dependencies>
|
27
|
+
<dependency>
|
28
|
+
<groupId>org.springframework.boot</groupId>
|
29
|
+
<artifactId>spring-boot-starter-web</artifactId>
|
30
|
+
</dependency>
|
31
|
+
<dependency>
|
32
|
+
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
33
|
+
<artifactId>jackson-dataformat-csv</artifactId>
|
34
|
+
<version>2.6.5</version>
|
35
|
+
</dependency>
|
36
|
+
<dependency>
|
37
|
+
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
38
|
+
<artifactId>jackson-dataformat-xml</artifactId>
|
39
|
+
<version>2.6.5</version>
|
40
|
+
</dependency>
|
41
|
+
<dependency>
|
42
|
+
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
43
|
+
<artifactId>jackson-dataformat-yaml</artifactId>
|
44
|
+
<version>2.6.5</version>
|
45
|
+
</dependency>
|
46
|
+
<dependency>
|
47
|
+
<groupId>org.codehaus.jackson</groupId>
|
48
|
+
<artifactId>jackson-core-asl</artifactId>
|
49
|
+
<version>1.9.13</version>
|
50
|
+
</dependency>
|
51
|
+
|
52
|
+
<dependency>
|
53
|
+
<groupId>org.codehaus.jackson</groupId>
|
54
|
+
<artifactId>jackson-mapper-asl</artifactId>
|
55
|
+
<version>1.9.13</version>
|
56
|
+
</dependency>
|
57
|
+
</dependencies>
|
58
|
+
<properties>
|
59
|
+
<java.version>1.8</java.version>
|
60
|
+
</properties>
|
61
|
+
<build>
|
62
|
+
<plugins>
|
63
|
+
<plugin>
|
64
|
+
<groupId>org.springframework.boot</groupId>
|
65
|
+
<artifactId>spring-boot-maven-plugin</artifactId>
|
66
|
+
</plugin>
|
67
|
+
</plugins>
|
68
|
+
</build>
|
69
|
+
</project>
|
70
|
+
|
71
|
+
#### Test.java
|
72
|
+
package es.nangel.logstash.webservicemap.test;
|
73
|
+
|
74
|
+
import org.springframework.boot.SpringApplication;
|
75
|
+
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
76
|
+
|
77
|
+
@SpringBootApplication
|
78
|
+
public class Test {
|
79
|
+
public static void main(String[] args) {
|
80
|
+
SpringApplication.run(Test.class, args);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
#### TestController.java
|
85
|
+
package es.nangel.logstash.webservicemap.test;
|
86
|
+
|
87
|
+
import org.springframework.web.bind.annotation.RequestMapping;
|
88
|
+
import org.springframework.web.bind.annotation.RestController;
|
89
|
+
|
90
|
+
import java.util.HashMap;
|
91
|
+
import java.util.Map;
|
92
|
+
|
93
|
+
@RestController
|
94
|
+
public class TestController {
|
95
|
+
|
96
|
+
@RequestMapping(value = "/json", produces = "application/json")
|
97
|
+
public Map<String, String> getElementJSON() {
|
98
|
+
Map<String, String> toReturn = new HashMap<>();
|
99
|
+
toReturn.put("200", "OK");
|
100
|
+
return toReturn;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
### 2. Logstash config example
|
105
|
+
|
106
|
+
input {
|
107
|
+
stdin{}
|
108
|
+
}
|
109
|
+
filter {
|
110
|
+
webservicemap {
|
111
|
+
field => "message"
|
112
|
+
map_url => "http://localhost:8080/json"
|
113
|
+
destination => "dest"
|
114
|
+
refresh_interval => 10
|
115
|
+
}
|
116
|
+
}
|
117
|
+
output {
|
118
|
+
stdout{
|
119
|
+
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
### 3. Execution example
|
124
|
+
Install with bin/plugin install webservicemap
|
125
|
+
bin/logstash -f config/myconf.conf --log logstash.log --debug
|
126
|
+
|
127
|
+
### 4. Results
|
128
|
+
#### Input
|
129
|
+
200
|
130
|
+
#### Output
|
131
|
+
{:timestamp=>"2016-03-13T10:41:50.264000+0100", :message=>"output received", :event=>{"message"=>"200", "@version"=>"1", "@timestamp"=>"2016-03-13T09:41:49.493Z", "host"=>"Mac-mini-de-angel.local", "dest"=>"OK"}, :level=>:debug, :file=>"(eval)", :line=>"47", :method=>"output_func"}
|
132
|
+
|
133
|
+
|
7
134
|
## Documentation
|
8
135
|
|
9
136
|
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
|
@@ -113,9 +113,9 @@ class LogStash::Filters::WebServiceMap < LogStash::Filters::Base
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def get_extension(path)
|
116
|
-
if path.end_with?('
|
116
|
+
if path.end_with?('json')
|
117
117
|
return '.json'
|
118
|
-
elsif path.end_with?('
|
118
|
+
elsif path.end_with?('csv')
|
119
119
|
return '.csv'
|
120
120
|
end
|
121
121
|
'.yml'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-webservicemap'
|
4
|
-
s.version = '1.0.
|
4
|
+
s.version = '1.0.1'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "A general search and replace tool which uses a configured web service to determine replacement values."
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-webservicemap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|