Author Topic: TCP session for Syslog  (Read 5452 times)

Philippe Parmentier

  • Newbie
  • Posts: 29
  • new in plc
    • View Profile
TCP session for Syslog
« on: March 18, 2014, 04:18:00 PM »
Hello,

I'm trying to set a syslog function that transfert logs to a syslog server.

The PRINT #4 "<TCPCONNECT xxx.xxx.xxx.xxx:514>" function work well,

but after I have to PRINT #4 the content of the TCP packet and the syslog protocol requied as a first parameter a value setting the emergency level in the format <XXX>.    It's seems that <XXX> is interpreted as a command tag and the packet is not generated and sended over the TCPIP. If i add a leading space, it's working well, but the packet is missformed and so pisinterpreted by the Syslog protocol.

Is there a way that I can send the <XXX> wihout being considered as a command tag?

Regards.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:TCP session for Syslog
« Reply #1 on: March 18, 2014, 09:32:49 PM »
Unfortunately it was not anticipated that the PRINT #4 command is required to send a string that begins with the '<' character and therefore it takes any string that begins with '<' as a tag to command it to do something such as closing of the TCP connection. Adding a leading space is a solution - is there a way for you to modify your syslog server script slightly to accept the command that begins with a space? Alternatively is there any other characters that your syslog server can accept and ignore before the '<' character?
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Philippe Parmentier

  • Newbie
  • Posts: 29
  • new in plc
    • View Profile
Re:TCP session for Syslog
« Reply #2 on: March 22, 2014, 09:28:44 AM »
The problem is that <> are in the protocol

https://www.ietf.org/rfc/rfc3164.txt

But anyway, if I remove that part of the protocol, the syslog is using a default value and the rest of the message can be displayed.

I've tried to send the first < via the outcomm 4,60
But it's seems that the buffer is analyzed by the firmware before beeins transmitted to the port.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:TCP session for Syslog
« Reply #3 on: March 23, 2014, 07:31:29 PM »
Note that as stated in the manual OUTCOMMAND command is not supported on port 4 (virtual serial port which only exists after a TCP connection has been established). So unfortunately you can't use OUTCOMM 4 to send the character.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS