Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syslog server
#1
Hi,
I am not a software devloper.
I started using Python to help me automate some tasks

I have logs forward from a syslog by udp (ip, port)

I want to receive the logs as a syslog server then analyse them in real time to trigger some actions

i am very confused about the docs and i dont know which one is the right one or what i need to do first
Reply
#2
I suggest you should start reading the file. You should read 7.2. Reading and Writing Files. A most simple example:

f = open ("/path/file.log", "r")
for line in f:
    print(line.strip())
f.close()
Reply
#3
thank you
but what i want is receiving the logs as a syslog server then analyse them in real time to trigger some actions
Reply
#4
i am still looking and need some help
Reply
#5
I'm unclear on what you want here. You mention docs - what docs? Are you trying to integrate with a particular system? If you can give technical details, that would be great.
Reply
#6
I found this one

https://gist.github.com/infinitylx/8f373...ysyslog-py
and it works
I didnt know how __name__ == "__main__": works so I could not make it work in the begining

Now I need to filter the messages , some actions need to be triggered by those messages

Thank you for the help
I may open a new post for filtring the message if I am stuck on it
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Parsing a syslog file ebolisa 11 4,102 Oct-10-2021, 05:15 PM
Last Post: snippsat
  How to take the tar backup files form remote server to local server sivareddy 0 1,895 Jul-14-2021, 01:32 PM
Last Post: sivareddy
  syslog module not built during cross compile colinliao 0 1,970 Feb-22-2019, 06:33 AM
Last Post: colinliao

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020