switch router to es payload encoder
diff --git a/heka/files/encoder/es_payload.toml b/heka/files/encoder/es_payload.toml
new file mode 100644
index 0000000..e3fd314
--- /dev/null
+++ b/heka/files/encoder/es_payload.toml
@@ -0,0 +1,8 @@
+[es_payload]
+type = "ESJsonEncoder"
+filename = "lua_encoders/es_payload.lua"
+
+    [es_payload.config]
+    es_index_from_timestamp = true
+    index = "%{Logger}-%{%Y.%m.%d}"
+    type_name = "%{Type}-%{Hostname}"
diff --git a/heka/files/output/elasticsearch.toml b/heka/files/output/elasticsearch.toml
index b50a5ac..f4acd54 100644
--- a/heka/files/output/elasticsearch.toml
+++ b/heka/files/output/elasticsearch.toml
@@ -3,6 +3,9 @@
 message_matcher = "{{ values.message_matcher }}"
 encoder = "{{ values.encoder }}"
 server = "http://{{ values.host }}:{{ values.port }}"
+flush_interval = {{ values.flush_interval }}
+flush_count = {{ values.flush_count }}
 
 [output_{{ name }}.buffering]
-max_file_size = 268435456
+max_file_size = 268435456 #256M
+max_buffer_size = 10737418240 #10G
diff --git a/metadata/service/server/amqp/router.yml b/metadata/service/server/amqp/router.yml
index 99b541a..6f55f4d 100644
--- a/metadata/service/server/amqp/router.yml
+++ b/metadata/service/server/amqp/router.yml
@@ -38,8 +38,10 @@
           engine: elasticsearch
           host: ${_param:heka_router_output_host}
           port: 9200
-          encoder: es_json
+          encoder: es_payload
           message_matcher: "Logger != 'hekad'"
+          flush_count: 10
+          flush_interval: 1000
         dashboard01:
           engine: dashboard
           ticker_interval: 30