Advertisement
Guest User

ciscoasa.conf

a guest
Mar 17th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. input {
  2. udp {
  3. port => 5000
  4. type => "ciscoasa"
  5. }
  6. }
  7.  
  8. filter {
  9. if [type] == "ciscoasa" {
  10. grok {
  11. patterns_dir => "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-patterns-core-2.0.2/patterns"
  12. match => ["message", "%{CISCO_TAGGED_SYSLOG} %{GREEDYDATA:cisco_message}"]
  13. }
  14.  
  15. date {
  16. match => ["timestamp",
  17. "MMM dd HH:mm:ss",
  18. "MMM d HH:mm:ss",
  19. "MMM dd yyyy HH:mm:ss",
  20. "MMM d yyyy HH:mm:ss"
  21. ]
  22. timezone => "Europe/Brussels"
  23. }
  24.  
  25. # Clean up redundant fields if parsing was successful
  26. if "_grokparsefailure" not in [tags] {
  27. mutate {
  28. rename => ["cisco_message", "message"]
  29. remove_field => ["timestamp"]
  30. }
  31. }
  32.  
  33. syslog_pri { }
  34. }
  35. }
  36.  
  37. output {
  38. if [type] == "ciscoasa" {
  39. if "_grokparsefailure" in [tags] or "_dateparsefailure" in [tags] {
  40. stdout { codec => rubydebug }
  41. file {
  42. path => "/var/log/logstash/failed_ciscoasa_events-%{+YYYY-MM-dd}"
  43. codec => "json_lines"
  44. }
  45. } else {
  46. elasticsearch {
  47. hosts => localhost
  48. index => "ciscoasa-%{+YYYY.MM.dd}"
  49. user => "--------"
  50. password => "-------"
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement