OnDemand User Group

Support Forums => iSeries => Topic started by: rajesh_400 on March 19, 2020, 08:35:41 AM

Title: retrieving sys logs from system i
Post by: rajesh_400 on March 19, 2020, 08:35:41 AM
Hi All,

I am trying to use below simple query to get system logs on 10.1v using arsdoc query. Please help what is wrong here.

arsdoc query -u xxx -p xx -G "System Log" -h uuuu -i "WHERE msg_num = 88 and time_stamp = 2020-03-15"
 -S "2020-03-14,2020-03-15,%Y-%m-%d"          -o outfilep -v                                                               


2020-03-19 11:32:48.315312: ARS6117I Querying database with SQL string 'WHERE msg_num = 88 and time_stamp = 2020-03-15'   
                                                                                                                           
2020-03-19 11:32:48.351616: ARS6085E Search unsuccessful                                                                   
                                                                                                                           
2020-03-19 11:32:48.351944: ARS6034W No hits were found that matched search criteria.                                     


Thank you very much!
  :)
Title: Re: retrieving sys logs from system i
Post by: Justin Derrick on March 19, 2020, 10:20:47 AM
Are you sure you're searching the correct field for time_stamp?  If you've upgraded your System Logs, you should have a time_stamp_dt field that contains the new database-native time format.

-JD.
Title: Re: retrieving sys logs from system i
Post by: rajesh_400 on March 19, 2020, 11:18:05 AM
Hi JD,

Thanks for your reply!

I am checking the System log app group and see time_stamp field (data type : Date/Time(TZ) (old style)) . So, i am using that field
Title: Re: retrieving sys logs from system i
Post by: rajesh_400 on March 19, 2020, 04:36:28 PM

I figured it now. Using the new fields worked!  :D

Thanks again JD!
Title: Re: retrieving sys logs from system i
Post by: Darrell Bryant on March 23, 2020, 06:47:37 AM
You can also use the native IBM i command, Query Document (QRYDOCOND). It is an easier to use front end to arsdoc query and is available at v7.2 and higher. See the Content Manager OnDemand newsletter for 2Q2016 and 3Q2017. Links can be found at https://www.ibm.com/support/pages/node/628001
Title: Re: retrieving sys logs from system i
Post by: Justin Derrick on March 24, 2020, 05:05:57 AM
And for future reference, here's a section in the wiki about CMOD Date & Time formats:

https://cmod.wiki/index.php?title=Date_and_Time_formats_in_Content_Manager_OnDemand

-JD.