Hi!
How can I read SYSLOG/OPERLOG/Console log records in my c/c++ application?
I can write to LOG using syslog() function, but is there any method to read the LOG programmatically?
Getting SYSLOG records from C app
-
bashly
- Posts: 8
- Joined: Wed Dec 24, 2014 7:25 pm
- Skillset: ISPF, TSO, C/C++ compiling, networking
- Referer: Internet
-
steve-myers
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Getting SYSLOG records from C app
Technically, yes. In theory - I've never done it - you can allocate the SYSLOG using dynamic allocation. You will have to use some of the fancier subsystem functions to get its JES2 "data set name." Once it is allocated you can read it using standard C functions like fopen / fgets.
When I want SYSLOG for analysis I use SDSF to "print" it to a data set, then read the data set. If the log has already been moved off JES2, you can read the data sets where it has been moved to. If you choose to use this method I strongly recommend that you "print" it to a data set allocated with variable length records. The data set will be much smaller, which should make your analysis program much faster.
When I want SYSLOG for analysis I use SDSF to "print" it to a data set, then read the data set. If the log has already been moved off JES2, you can read the data sets where it has been moved to. If you choose to use this method I strongly recommend that you "print" it to a data set allocated with variable length records. The data set will be much smaller, which should make your analysis program much faster.
-
bashly
- Posts: 8
- Joined: Wed Dec 24, 2014 7:25 pm
- Skillset: ISPF, TSO, C/C++ compiling, networking
- Referer: Internet
Re: Getting SYSLOG records from C app
Thank you, Steve!
-
- Similar Topics
- Replies
- Views
- Last post
-
- 6
- 4377
-
by sergeyken
View the latest post
Thu Dec 09, 2021 8:10 pm
-
- 3
- 5876
-
by naveenkumar sudha
View the latest post
Mon May 09, 2022 10:15 pm
-
-
Need help with concatenating records in a dataset
by Terra » Mon Mar 09, 2026 10:46 am » in DFSORT/ICETOOL/ICEGENER - 10
- 2244
-
by sergeyken
View the latest post
Thu Mar 12, 2026 10:30 pm
-
-
-
Dropped records when FTP from mainframe to server
by MLK2348 » Tue Mar 19, 2024 9:19 pm » in All other Mainframe Topics - 2
- 6283
-
by sergeyken
View the latest post
Tue Apr 02, 2024 9:32 pm
-
-
-
Join parts of two records from same file
by Mickes » Thu Apr 27, 2023 3:47 am » in DFSORT/ICETOOL/ICEGENER - 3
- 3586
-
by sergeyken
View the latest post
Sat Apr 29, 2023 1:32 pm
-