07-01-2008 11:08 AM
hi
I am trying to use the above FM to read audit logs from a network of several application servers.
One of the IMPORT paramters is SELECTION-RFCDEST.
Does anyone know what parameter I have to put in for the FM to collect the audit logs from all
application servers.
Giving no prameter at all brings back the central instance audit log only.
Thank you in advance
yuval
07-01-2008 11:12 AM
Peery,
Just use like that:
CALL FUNCTION 'RSAU_READ_FILE'
DESTINATION ls_all_dests-rfcdest
EXPORTING
selection = ta
selection_audit = ta_audit
file_no_old = file_no
IMPORTING
end_reason = end_reason
end_info = end_info
counters = l_recordcnt
file_no_new = file_no
TABLES
syslog_in_table = it_entriestab_2
audit_file_stat = audit_file_stat_rfc
EXCEPTIONS
system_failure = 2 MESSAGE last_rfc_mess
communication_failure = 3 MESSAGE last_rfc_mess.
Amit.
07-01-2008 11:15 AM
Hi Amit
Thank you for your reply
I will try to incorporate it in my call.
However suppose oyu use transaction SE37 to
run this FM, how do you then put a valid parameter in RFCDEST????
regards
yuval
07-01-2008 11:18 AM
07-01-2008 11:23 AM
Amit
If I leave it blank it does not fetch logs from the various application servers.
If I run SM20 using 'ALL_AUDIT_LOGS', I get a different report this time specfying
all application servers.
Thank you
Yuval
07-01-2008 11:44 AM
Hi Yuval
you can follow this
use fm TH_SERVER_LIST to get the servers list
you'll get that in an internal table (of type msxxlist ex:serv_list)
loop at that and call the RSAU_READ_FILE within the loop
giving the destination from the server list.
ex coding:
DATA : serv_list TYPE TABLE OF msxxlist .
DATA : wa_servlist LIKE LINE OF serv_list.
DATA: BEGIN OF all_dests OCCURS 100.
INCLUDE STRUCTURE rfchosts.
DATA: access TYPE i, " 0=active, 4=not active
END OF all_dests.
CALL FUNCTION 'TH_SERVER_LIST'
TABLES
list = serv_list
EXCEPTIONS
no_server_list = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF NOT serv_list[] IS INITIAL.
LOOP AT serv_list INTO wa_servlist.
all_dests-rfcdest = wa_servlist-name.
all_dests-access = 0.
APPEND all_dests.
CLEAR :wa_servlist,all_dests.
ENDLOOP.
ENDIF.
LOOP AT all_dests.
IF all_dests-access <> 0.
CLEAR rec_cnts.
MOVE 'R' TO rec_cnts-kind.
MOVE-CORRESPONDING ta TO rec_cnts.
MOVE all_dests-access TO rec_cnts-errrc.
APPEND rec_cnts.
ELSE.
ta-rfcdest = all_dests-rfcdest.
CLEAR rec_cnts.
MOVE 'R' TO rec_cnts-kind.
MOVE-CORRESPONDING ta TO rec_cnts.
REFRESH entriestab_2.
REFRESH audit_file_stat_rfc.
CALL FUNCTION 'RSAU_READ_FILE'
DESTINATION all_dests-rfcdest
EXPORTING
selection = ta
selection_audit = ta_audit
file_no_old = file_no
IMPORTING
end_reason = end_reason
end_info = end_info
counters = recordcnt
file_no_new = file_no
TABLES
syslog_in_table = entriestab_2
audit_file_stat = audit_file_stat_rfc
EXCEPTIONS
system_failure = 2 MESSAGE last_rfc_mess
communication_failure = 3 MESSAGE last_rfc_mess.
IF sy-subrc <> 0.
rec_cnts-errrc = sy-subrc.
rec_cnts-errmess = last_rfc_mess.
ELSE.
LOOP AT entriestab_2.
entriestab = entriestab_2.
APPEND entriestab.
ENDLOOP.
LOOP AT audit_file_stat_rfc.
audit_file_stat = audit_file_stat_rfc.
APPEND audit_file_stat.
ENDLOOP.
MOVE-CORRESPONDING recordcnt TO rec_cnts.
ENDIF.
APPEND rec_cnts.
CLEAR recordcnt.
ENDIF.
ENDLOOP.
hope this will clear ur doubt.
reward is useful
Regards
Prabumanoharan
08-21-2008 12:29 PM
02-05-2016 9:38 AM
Could anybody solve the problem, to get the audit-log CONTENT ?
Kind regards