× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here it is....

SELECT * FROM TABLE(QSYS2.HISTORY_LOG_INFO(<timestamp from>, <timestamp thru)) X                                                          

Here is the info....
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/IBM%20i%20Technology%20Updates/page/QSYS2.HISTORY_LOG_INFO%20UDTF

Example - Profiles disabled in last 24 hours
SELECT *
FROM TABLE(QSYS2.HISTORY_LOG_INFO(current timestamp - 1 day)) X
WHERE MESSA00007 like '%disabled%'


Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power

 
 





From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxx> on behalf of Roger Harman <roger.harman@xxxxxxxxxxx>
Sent: Tuesday, March 14, 2017 1:05 PM
To: Midrange Systems Technical Discussion
Subject: RE: Is there a way to DSPLOG LOG(QHST) OUTPUT(*PRINT) MSGID(CPF3145) to an outifle or to a spoolfile that doesn't wrap.
 
Depending on the release/level you're on, you can use a table function that was added to the DB2 services.  Not at my computer now or I could give you the details.  I know it is in 7.2 TR5.



Sent from my Galaxy Tab® A


-------- Original message --------
From: "Hiebert, Chris" <chris.hiebert@xxxxxxxxxxxxxx>
Date: 3/14/17 9:38 AM (GMT-08:00)
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: RE: Is there a way to DSPLOG LOG(QHST) OUTPUT(*PRINT) MSGID(CPF3145) to an outifle or to a spoolfile that doesn't wrap.

You could potentially query the history log files directly.

Depending on the message you are tracking, you may be able to get the information you need easily.
The messages I've needed to find are mostly just text data and I can find the messages using a simple substring.
I've used this method on V7R1 using the new iAccess Client SQL tool.


First you would need to find the log file (or files) to query.

CL: DSPOBJD OBJ(QSYS/QHST*) OBJTYPE(*FILE) OUTPUT(*OUTFILE) OUTFILE(QTEMP/QHST_LOG);
SELECT * FROM QTEMP /QHST_LOG;

Locate the file by the date and time.

Then, using the log file name, you can query the log and get the entry that you want.

Here is a query I put together to track the number of SIGNON requests showing up in the log:

with t1 (usr, wkts, wktm, wkhm) as (
SELECT
SUBSTR(
  SYSLOGFLD,
  Position( 'for user' IN syslogfld  )+9,
  Position( 'in subsystem' IN syslogfld  )-(Position( 'for user' IN syslogfld  )+9))
,SUBSTR( SYSLOGFLD, Position( '03/14/17' IN syslogfld  ), 17)
,SUBSTR( SYSLOGFLD, Position( '03/14/17' IN syslogfld  )+9, 8)
,SUBSTR( SYSLOGFLD, Position( '03/14/17' IN syslogfld  )+9, 5)
FROM QSYS/QHST17073F
WHERE syslogfld like '%SIGNON%' and  Position( '03/14/17' IN syslogfld  ) > 0
) select wkhm, count(*) from t1 group by wkhm order by wkhm
;

If you wanted to include multiple log files at the same time you could use a union.
Just change the "FROM QSYS/QHST17073F" to:

FROM (select * from QSYS/QHST17073b
union all select * from QSYS/QHST17073C
union all select * from QSYS/QHST17073D
union all select * from QSYS/QHST17073E
union all select * from QSYS/QHST17073F
) T1


Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Steinmetz, Paul
Sent: Saturday, 18 February 2017 10:49 AM
To: 'Midrange Systems Technical Discussion'
Subject: [IE] Is there a way to DSPLOG LOG(QHST) OUTPUT(*PRINT) MSGID(CPF3145) to an outifle or to a spoolfile that doesn't wrap.

Is there a way to DSPLOG LOG(QHST) OUTPUT(*PRINT) MSGID(CPF3145) to an outifle or to a spoolfile that doesn't wrap.

I need an easy way to track access path rebuilds.
The below wraps, not easy to read.
I'd like to dump the output, sort descending by the time used field 00:00:01.

DSPLOG LOG(QHST) OUTPUT(*PRINT) MSGID(CPF3145)

5770SS1 V7R1M0 100423                                   History Log                 PENCOR06  2/17/17  8:39:39        Page  0001
MSGID    SEV MSG TYPE
CPF3145  00  INFO         Access path built for member CBG7REL0 file CBG7REL0 library CABLEFILES in 00:00:01.
                      QDBSRV04   QSYS       150219 QDBMAINT     0000 02/17/17 00:26:00.115878 QSYS
CPF3145  00  INFO         Access path built for member CBBOREL0 file CBBOREL0 library CABLEFILES in 00:00:01.
                      QDBSRV05   QSYS       150220 QDBMAINT     0000 02/17/17 00:26:00.163651 QSYS
CPF3145  00  INFO         Access path built for member CBIWREL0 file CBIWREL0 library CABLEFILES in 00:00:01.
                      QDBSRV04   QSYS       150219 QDBMAINT     0000 02/17/17 00:26:00.176451 QSYS
CPF3145  00  INFO         Access path built for member CBJEREL0 file CBJEREL0 library CABLEFILES in 00:00:01.
                      QDBSRV04   QSYS       150219 QDBMAINT     0000 02/17/17 00:26:00.276308 QSYS
CPF3145  00  INFO         Access path built for member TOLRSQ03 file TOLRSQ03 library BRFILES in 01:23:54.
                      QDBSRV05   QSYS       150220 QDBMAINT     0000 02/14/17 03:45:10.908309 QSYS
CPF3145  00  INFO         Access path built for member TOLRSQ01 file TOLRSQ01 library BRFILES in 01:21:52.

Thank You
_____
Paul Steinmetz
IBM i Systems Administrator
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.