Class RFC5424SyslogParser

java.lang.Object
org.springframework.integration.syslog.RFC5424SyslogParser

public class RFC5424SyslogParser
extends java.lang.Object
Parse for RFC 5424 syslog messages; when used with TCP, requires the use of a RFC6587SyslogDeserializer which decodes the framing.
Since:
4.1.1
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    protected static class  RFC5424SyslogParser.Reader  
    protected static class  RFC5424SyslogParser.Severity  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected static char NILVALUE  
    protected boolean retainOriginal  
    protected static char SPACE  
  • Constructor Summary

    Constructors 
    Constructor Description
    RFC5424SyslogParser()
    Construct a default parser; do not retain the original message content unless there is an error.
    RFC5424SyslogParser​(boolean retainOriginal)  
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.Object getTimestamp​(RFC5424SyslogParser.Reader r)
    Default implementation returns the date as a String (if present).
    java.util.Map<java.lang.String,​?> parse​(java.lang.String lineArg, int octetCount, boolean shortRead)  
    protected java.lang.Object parseStructuredDataElements​(RFC5424SyslogParser.Reader r)
    Default implementation returns a list of structured data elements with no internal parsing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RFC5424SyslogParser

      public RFC5424SyslogParser()
      Construct a default parser; do not retain the original message content unless there is an error.
    • RFC5424SyslogParser

      public RFC5424SyslogParser​(boolean retainOriginal)
      Parameters:
      retainOriginal - when true, include the original message content intact in the map.
  • Method Details

    • parse

      public java.util.Map<java.lang.String,​?> parse​(java.lang.String lineArg, int octetCount, boolean shortRead)
    • getTimestamp

      protected java.lang.Object getTimestamp​(RFC5424SyslogParser.Reader r)
      Default implementation returns the date as a String (if present).
      Parameters:
      r - the reader.
      Returns:
      the timestamp.
    • parseStructuredDataElements

      protected java.lang.Object parseStructuredDataElements​(RFC5424SyslogParser.Reader r)
      Default implementation returns a list of structured data elements with no internal parsing.
      Parameters:
      r - the reader.
      Returns:
      the structured data.