Advertisement
CatDaaaady

syslogng parser issues

Feb 6th, 2012
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1.  
  2. I can only assume I am not implementing this correctly. :-)
  3.  
  4. But I have a parser I am trying to use so I can take a subset of the
  5. information of a message and send that subset to another receiver.
  6. This is the whole message:
  7.  
  8. <13>Feb 4 18:40:17 myhost syslogng: 2012-02-04T18:40:17-08:00
  9. myhostserver-http /tmp/logs/access_log Hi Mom
  10.  
  11. What I want to do is send out the message as :
  12.  
  13. <13>Feb 4 18:40:17 myhost syslogng: Hi Mom
  14.  
  15. Notice how I dropped the middle part out.
  16.  
  17. From what I have read, the parser acts on the message body alone. Is
  18. this correct?
  19. So I set it up to look for four(4) columns of data and to be "greedy"
  20. on the last column.
  21.  
  22. I have played around with the number of columns and even used a
  23. rewrite function instead. But the Parser continues to produce empty
  24. variables. And my template just echos out my default value.
  25.  
  26. Any thoughts?
  27.  
  28.  
  29.  
  30.  
  31.  
  32. parser p_et_logmessage {
  33. csv-parser(
  34. #columns("ETMSG")
  35. #columns("ETMSG.ISODATE")
  36. columns("ETMSG.ISODATE", "ETMSG.EASI", "ETMSG.SOURCE",
  37. "ETMSG.BODY")
  38. delimiters(" ")
  39. #template("${MSG}")
  40. flags(greedy)
  41. );
  42. };
  43.  
  44. rewrite r_rewrite_set{set('${ETMSG.BODY:-nothing}', value("MESSAGE"));};
  45.  
  46. template t_et_basic_logmessage {
  47. template("${ETMSG.BODY:-nothing}\n"); template_escape(no); };
  48.  
  49.  
  50. destination destination_info {
  51. tcp("host2" port(8080)
  52. template(t_et_basic_logmessage)
  53. log_disk_fifo_size(32212254720)
  54. );
  55. };
  56.  
  57. log {
  58. source(INTAKE);
  59. parser(p_et_logmessage);
  60. destination(destination_info);
  61. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement