Advertisement
Guest User

Untitled

a guest
Dec 28th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. input {
  2. tcp {
  3. port => 9001
  4. codec => "json_lines"
  5. add_field => {
  6. "platform" => "digital"
  7. "environment" => "prod"
  8. }
  9. }
  10. tcp {
  11. port => 9002
  12. codec => "json_lines"
  13. add_field => {
  14. "platform" => "digital"
  15. "environment" => "preprod"
  16. }
  17. }
  18. tcp {
  19. port => 9003
  20. codec => "json_lines"
  21. add_field => {
  22. "platform" => "digital"
  23. "environment" => "recette"
  24. }
  25. }
  26.  
  27. beats {
  28. port => 9004
  29. add_field => {
  30. "platform" => "UBW"
  31. "environment" => "prod"
  32. }
  33. }
  34.  
  35. beats {
  36. port => 9005
  37. add_field => {
  38. "platform" => "pi"
  39. "environment" => "prod"
  40. }
  41. }
  42.  
  43. beats {
  44. port => 9006
  45. add_field => {
  46. "platform" => "export"
  47. "environment" => "prod"
  48. }
  49. }
  50.  
  51. beats {
  52. port => 9007
  53. add_field => {
  54. "platform" => "DNS"
  55. "environment" => "prod"
  56. }
  57. }
  58.  
  59. beats {
  60. port => 9008
  61. add_field => {
  62. "platform" => "logs"
  63. "environment" => "prod"
  64. }
  65. }
  66.  
  67. beats {
  68. port => 9009
  69. add_field => {
  70. "platform" => "tools"
  71. "environment" => "prod"
  72. }
  73. }
  74.  
  75. syslog {
  76. port => 9010
  77. id => "syslog_phenix_proxy-datacard"
  78. add_field => {
  79. "platform" => "proxy-datacard"
  80. "environment" => "prod"
  81. }
  82. }
  83.  
  84. syslog {
  85. port => 9011
  86. id => "syslog_digital_prod"
  87. add_field => {
  88. "platform" => "digital"
  89. "environment" => "prod"
  90. }
  91. }
  92. syslog {
  93. port => 9012
  94. id => "syslog_digital_preprod"
  95. add_field => {
  96. "platform" => "digital"
  97. "environment" => "preprod"
  98. }
  99. }
  100. syslog {
  101. port => 9013
  102. id => "syslog_digital_recette"
  103. add_field => {
  104. "platform" => "digital"
  105. "environment" => "recette"
  106. }
  107. }
  108.  
  109. beats {
  110. port => 9014
  111. add_field => {
  112. "platform" => "bounce"
  113. "environment" => "prod"
  114. }
  115. }
  116. }
  117.  
  118.  
  119. filter {
  120. mutate {
  121. add_field => { "indexed_by" => "shipper-de-a" }
  122. }
  123.  
  124. if [platform] == "UBW" {
  125. if [fields][application] == "export-agresso" {
  126. mutate {
  127. rename => { "message" => "original_message" }
  128. }
  129. dissect {
  130. mapping => { "original_message" => "%{ts} %{+ts};%{loglevel};%{message}" }
  131. }
  132. }
  133. }
  134.  
  135. if [platform] == "DNS" and [type] == "log" and [source] == "/var/log/unbound/unbound.log" {
  136. dissect {
  137. mapping => {
  138. "message" => "[%{unbound.query_ts}] %{unbound.proc_name}[%{unbound.pid}:%{unbound.thread_no}] %{unbound.log_level}: %{unbound.message}"
  139. }
  140. }
  141. date {
  142. match => [ "unbound.query_ts", "UNIX" ]
  143. timezone => "Europe/Paris"
  144. target => "unbound.query_ts"
  145. }
  146. grok {
  147. match => { "unbound.message" => ["%{IP:unbound.query.client} %{HOSTNAME:unbound.query.domain} %{WORD:unbound.query.type} %{WORD:unbound.query.class}",
  148. "%{GREEDYDATA:unbound.message}"]}
  149. }
  150. }
  151. }
  152.  
  153. output {
  154. if [platform] == "talend" {
  155. elasticsearch {
  156. index => "talend-%{+YYYY.MM.dd}"
  157. hosts => ["https://elasticsearch-alb:9200"]
  158. }
  159. } else if [type] == "wineventlog" {
  160. elasticsearch {
  161. index => "winlogbeat-%{+YYYY.MM.dd}"
  162. hosts => ["https://elasticsearch-alb:9200"]
  163. }
  164. } else if [type] == "metricsets" {
  165. elasticsearch {
  166. index => "metricbeat-%{+YYYY.MM.dd}"
  167. hosts => ["https://elasticsearch-alb:9200"]
  168. }
  169. } else if [platform] == "digital" {
  170. elasticsearch {
  171. index => "digital-%{+YYYY.MM.dd}"
  172. hosts => ["https://elasticsearch-alb:9200"]
  173. }
  174. } else {
  175. elasticsearch {
  176. hosts => ["https://elasticsearch-alb:9200"]
  177. }
  178. }
  179. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement