<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="generator" content="Osso Notes">
    <title></title></head>
<body>
<p>hi,
<br>
<br>It seems you are receiving those messages via no-parse flag, or something like udp() source driver.
<br>
<br>you need to use the syslog() source driver to tell syslog-ng to expect the rfc5424 format and parse it properly.
<br>
<br>----- Original message -----
<br>&gt; I have successfully written parsers for unstructured logs, but would
<br>&gt; like to be able to leverage SDATA. Based on what I have researched so
<br>&gt; far, I have built the following skeleton conf file for writing to mongodb
<br>&gt; 
<br>&gt; #####Filter#####
<br>&gt; filter f_session_close {message("RT_FLOW_SESSION_CLOSE");};
<br>&gt; 
<br>&gt; #####Destinations#####
<br>&gt; 
<br>&gt; destination d_mongodb_close {
<br>&gt; &nbsp;&nbsp;&nbsp; mongodb(
<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; collection("close")
<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; value-pairs(
<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; scope(rfc5424 sdata)
<br>&gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; )
<br>&gt; &nbsp;&nbsp;&nbsp; );
<br>&gt; };
<br>&gt; 
<br>&gt; #####Log#####
<br>&gt; log {
<br>&gt; &nbsp;&nbsp;&nbsp; source(s_network);
<br>&gt; &nbsp;&nbsp;&nbsp; filter(f_session_close);
<br>&gt; &nbsp;&nbsp;&nbsp; destination(d_mongodb_close);
<br>&gt; };
<br>&gt; 
<br>&gt; With this in mind, I get the following logs with only the rfc5424 scope:
<br>&gt; 
<br>&gt; &nbsp;&nbsp;&nbsp; "DATE" : "Oct&nbsp; &#32;5 20:40:21",
<br>&gt; &nbsp;&nbsp;&nbsp; "FACILITY" : "user",
<br>&gt; &nbsp;&nbsp;&nbsp; "HOST" : "192.168.199.2",
<br>&gt; &nbsp;&nbsp;&nbsp; "MESSAGE" : "2012-10-05T20:40:20.444 SRX100 RT_FLOW -
<br>&gt; RT_FLOW_SESSION_CREATE [<a href="mailto:junos@2636.1.1.1.2.36">junos@2636.1.1.1.2.36</a>
<br>&gt; source-address=\"192.168.199.207\" source-port=\"55625\"
<br>&gt; destination-address=\"130.57.4.24\" destination-port=\"80\"
<br>&gt; service-name=\"junos-http\" nat-source-address=\"50.193.12.149\"
<br>&gt; nat-source-port=\"28178\" nat-destination-address=\"130.57.4.24\"
<br>&gt; nat-destination-port=\"80\" src-nat-rule-name=\"source-nat-rule\"
<br>&gt; dst-nat-rule-name=\"None\" protocol-id=\"6\"
<br>&gt; policy-name=\"trust-to-untrust\" source-zone-name=\"trust\"
<br>&gt; destination-zone-name=\"untrust\" session-id-32=\"61189\"
<br>&gt; username=\"N/A\" roles=\"N/A\" packet-incoming-interface=\"vlan.0\"]",
<br>&gt; &nbsp;&nbsp;&nbsp; "PRIORITY" : "info",&nbsp;&nbsp;&nbsp; "PROGRAM" : "1",&nbsp;&nbsp;&nbsp; "_id" :
<br>&gt; ObjectId("506fa825817f52de65000001")
<br>&gt; 
<br>&gt; When using the SDATA scope, I only get an object id. None of the
<br>&gt; structured data is ever parsed.
<br>&gt; 
<br>&gt; Is there something special I need to do to parse the structured portion
<br>&gt; of the messge? 
<br>&gt; 
<br>&gt; Chris
<br>&gt; ______________________________________________________________________________
<br>&gt; Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
<br>&gt; Documentation:
<br>&gt; <a href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a> FAQ:
<br>&gt; <a href="http://www.balabit.com/wiki/syslog-ng-faq">http://www.balabit.com/wiki/syslog-ng-faq</a>
<br>&gt; 
<br><br></p>
</body>
</html>