Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. input {
  2. azureeventhub {
  3. key => "KEY1"
  4. username => "USERNAME1"
  5. namespace => "NAMESPACE1"
  6. eventhub => "loggingeventhub"
  7. partitions => 4
  8. codec => "json"
  9. type => "production"
  10. }
  11. azureeventhub {
  12. key => "KEY2"
  13. username => "USERNAME2"
  14. namespace => "NAMESPACE2"
  15. eventhub => "loggingeventhub"
  16. partitions => 4
  17. codec => "json"
  18. type => "develop"
  19. }
  20. }
  21.  
  22. filter {
  23. ruby {
  24. code => " if event['message']
  25. event['message'] = event['message'].gsub('\q','q')
  26. event['message'] = event['message'].gsub('\x','Xx')
  27. event['message'] = event['message'].gsub('\\x','XXx')
  28. event['message'] = event['message'].gsub('Xx5c','\\')
  29. end
  30. "
  31. }
  32.  
  33. json {
  34. source => "message"
  35. }
  36. }
  37.  
  38. output {
  39. if [type] == "production" {
  40. elasticsearch {
  41. hosts => ["localhost:9200"]
  42. user => "ESUSER"
  43. password => "ESPASS"
  44. index => "production-%{+YYYY.MM.dd}"
  45. }
  46. }
  47. else if [type] == "baas_qa" {
  48. elasticsearch {
  49. hosts => ["localhost:9200"]
  50. user => "ESUSER"
  51. password => "ESPASS"
  52. index => "develop-%{+YYYY.MM.dd}"
  53. }
  54. }
  55.  
  56. } else {
  57. file {
  58. path => "/var/log/logstash/output"
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement