Advertisement
Guest User

Untitled

a guest
Feb 8th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. =======================================================================================
  2. ## /etc/logstash/conf.d/logstash.conf ##
  3. # Inputs
  4. input {
  5. udp {
  6. port => 10113
  7. type => "sonicwall"
  8. }
  9. udp {
  10. port => 10112
  11. type => "cisco"
  12. }
  13. beats {
  14. port => "10114"
  15. }
  16. udp {
  17. port => 9995
  18. codec => netflow {
  19. definitions => "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-codec-netflow-3.2.2/lib/logstash/codecs/netflow/netflow.yaml"
  20. versions => [5]
  21. }
  22. type => "netflow"
  23. }
  24. }
  25.  
  26. # Filters
  27. filter {
  28. if [type] == "sonicwall" {
  29. grok {
  30. match => ["message" , ".+sn=%{WORD:serial}.+time=\"%{YEAR}-%{MONTHNUM}-%{MONTHDAY}.%{TIME}.+fw=%{IP:FirewallWAN}.+pri=%{NONNEGINT:priority}.+m=%{NONNEGINT:message ID}(.+msg=%{QS:message})?.+n=%{NONNEGINT:message-count}.+src=%{IP:source}:%{NONNEGINT:source-port}:%{WORD:source-interface}.+dst=%{IP:destination}:%{NONNEGINT:destination-port}:%{WORD:destination-interface}.+proto=%{NOTSPACE:protocol}(.+op=%{INT:OpCode})?(.+sent=%{INT:sent})?(.+rcvd=%{INT:rcvd})?(.+dstname=%{HOSTNAME:destination-host})?(.+arg=%{NOTSPACE:destination-path})?(.+code=%{INT:code})?(.+Category=%{QS}.)?"]
  31. overwrite => ["message"]
  32. }
  33. }
  34. }
  35. # Outputs
  36. output {
  37. if [type] == "sonicwall" {
  38. elasticsearch {
  39. index => "firewall"
  40. hosts => ["localhost:9200"]
  41. }
  42. }
  43. if [type] == "cisco" {
  44. elasticsearch {
  45. index => "switch"
  46. hosts => ["localhost:9200"]
  47. }
  48. }
  49. if [type] == "wineventlog" {
  50. elasticsearch {
  51. index => "server"
  52. hosts => ["localhost:9200"]
  53.  
  54. }
  55. }
  56. if [type] == "netflow" {
  57. elasticsearch {
  58. index => "netflow"
  59. hosts => ["localhost:9200"]
  60. }
  61. stdout {}
  62. }
  63. }
  64.  
  65. ===============================================================================================================
  66. ## Results from sudo /usr/share/logstash/bin/logstash -t --path.settings /etc/logstash ##
  67. cat /var/log/logstash/logstash-plain.log
  68. [2017-02-08T14:13:58,157][INFO ][logstash.runner ] Using config.test_and_exit mode. Config Validation Result: OK. Exiting Logstash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement