summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/init.go1
-rw-r--r--output/http/http.go24
-rw-r--r--stasher.cfg2
3 files changed, 26 insertions, 1 deletions
diff --git a/conf/init.go b/conf/init.go
index f7d1761..9ace855 100644
--- a/conf/init.go
+++ b/conf/init.go
@@ -9,5 +9,6 @@ import (
_ "github.com/Shugyousha/stasher/filter/http"
_ "github.com/Shugyousha/stasher/filter/str"
+ _ "github.com/Shugyousha/stasher/output/http"
_ "github.com/Shugyousha/stasher/output/stdout"
)
diff --git a/output/http/http.go b/output/http/http.go
new file mode 100644
index 0000000..9caa1b9
--- /dev/null
+++ b/output/http/http.go
@@ -0,0 +1,24 @@
+package http
+
+import (
+ "fmt"
+
+ "github.com/Shugyousha/stasher/output"
+ "github.com/Shugyousha/stasher/registry"
+ "github.com/Shugyousha/stasher/work"
+)
+
+func init() {
+ registry.Outputregistry["http"] = New
+}
+
+type HttpOutput struct {
+}
+
+func New(map[string]string) output.Output {
+ return &HttpOutput{}
+}
+
+func (h *HttpOutput) Output(w *work.Work) {
+ fmt.Printf("%s\n", w.Data)
+}
diff --git a/stasher.cfg b/stasher.cfg
index 1ad9d37..46b6da2 100644
--- a/stasher.cfg
+++ b/stasher.cfg
@@ -14,7 +14,7 @@ output {
codec => "rubydebug"
}
- stdout {
+ http {
hosts => ["localhost:9200"]
}
}