Advertisement
Guest User

Untitled

a guest
Mar 28th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. input {
  2.  
  3. file {
  4. # start_position => "beginning"
  5. path => "C:/smarts/events/smarts*.txt"
  6. start_position => "end"
  7. codec => "json"
  8. sincedb_path => "C:/logstash/smarts.sincedb"
  9. tags => "smarts"
  10. }
  11.  
  12. udp {
  13. codec => plain {
  14. charset => "ISO-8859-1"
  15. }
  16. host => "10.20.16.198"
  17. port => 5514
  18. tags => "syslog"
  19. #debug => true
  20. workers => 2
  21. queue_size => 10000
  22. }
  23.  
  24. udp {
  25. codec => plain {
  26. charset => "ISO-8859-1"
  27. }
  28. host => "10.20.16.198"
  29. port => 515
  30. tags => "aaa"
  31. #debug => true
  32. workers => 1
  33. queue_size => 10000
  34. }
  35.  
  36. tcp {
  37. host => "10.20.16.198"
  38. port => 81
  39.  
  40. }
  41. }
  42.  
  43. filter {
  44. if ("aaa" in [tags]){
  45. # Match only messages from Cisco ACS. Capture the header & message ignoring
  46. # the sequence numbers, and tag it. The clue is the "CSCOacs_*" string
  47.  
  48. grok {
  49. match => [ "message","(?<acs_header><%{POSINT}>%{CISCOTIMESTAMP:cisco_timestamp} %{HOSTNAME:acs_server} CSCOacs_%{DATA:acs_type} )%{INT:acs_messageid} %{INT:number_of_lines} %{INT:line_number} %{GREEDYDATA:acs_message}"]
  50. }
  51.  
  52. # Multiline filter only acts on message so copy the captured message in
  53. mutate {
  54. replace => [ "message", "%{acs_message}" ]
  55. }
  56. # Any message not beginning with a datestamp should be joined to the
  57. # previous line
  58. multiline {
  59. pattern => "^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}"
  60. negate => true
  61. what => "previous"
  62. stream_identity => "%{acs_server}"
  63. }
  64.  
  65. }
  66. }
  67.  
  68.  
  69. output {
  70.  
  71. #if ( "aaa" in [tags] ) {
  72. #
  73. # stdout {
  74. # debug => true
  75. # debug_format => "ruby"
  76. # # only emit events with the 'metric' tag
  77. # tags => "metric"
  78. # message => "rate: %{events.rate_1m}"
  79. # }
  80. # }
  81.  
  82.  
  83. if ( "syslog" in [tags] ) {
  84. rabbitmq {
  85. exchange => "logstash.syslog.co1"
  86. exchange_type => "direct"
  87. host => "gns-redis"
  88. port => "5672"
  89. workers => 2
  90. }
  91. }
  92.  
  93. if ( "aaa" in [tags] ) {
  94. rabbitmq {
  95. exchange => "logstash.aaa.co1"
  96. exchange_type => "direct"
  97. host => "gns-redis"
  98. port => "5672"
  99. workers => 2
  100. }
  101. }
  102.  
  103. if ( "smarts" in [tags] ) {
  104. rabbitmq {
  105. exchange => "logstash.smarts.co1"
  106. exchange_type => "direct"
  107. host => "gns-redis"
  108. port => "5672"
  109. workers => 2
  110.  
  111. }
  112. }
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement