从通过 ADDRESS TSO 发出的 RLIST 命令中删除审核跟踪

发布于 2025-01-12 10:44:05 字数 404 浏览 0 评论 0原文

我正在尝试编写一个脚本,该脚本将查询 RACF 类中的特定资源配置文件,然后执行一些逻辑来匹配一些不相关的内容。

问题是,当我发出下面的命令时,我在终端上看到了 AUDIT TRAIL。该脚本仅返回 1 或 0。所有逻辑都按其应有的方式工作,但是当我运行该脚本时,我从 RACF 获取整个 AUDIT TRAIL 并在底部得到结果。

    y = outtrap('resourceAccess.')
        address tso 'RLIST CLASSX CLASSX.RESOURCE.LIST'
    y = outtrap('off')

我已经尝试在上面的一个之后创建另一个 outtrap 但没有成功。

有没有办法删除该 AUDIT TRAIL 位?

I'm trying to write a script that would query specific resource profiles in a RACF class and later do a bit of logic to match a few things - not relevant.

The problem is that when I issue the command below I get the AUDIT TRAIL on the terminal. The script is meant to just return a 1 or a 0. All the logic works as it should but when I run the script I get the whole AUDIT TRAIL from RACF and at the bottom the result.

    y = outtrap('resourceAccess.')
        address tso 'RLIST CLASSX CLASSX.RESOURCE.LIST'
    y = outtrap('off')

I already tried to create another outtrap after the one above with no success.

Is there a way to remove that AUDIT TRAIL bit?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

恰似旧人归 2025-01-19 10:44:05

这些文本行可能以无法使用 outtrap 捕获的方式发出,而是被放置在外部数据队列 (EDQ) 上,然后在 REXX 发生时回显到终端退出。 ACF2 对所有输出都执行此操作,使得捕获命令响应有点棘手。

试试这个:

/* Trap command response*/
y = outtrap('temp.')
    address tso 'RLIST CLASSX CLASSX.RESOURCE.LIST'
y = outtrap('off')

/* Display anything put onto the EDQ */
do queued()
   pull line
   say line
end

旧答案:
如果您获得的输出与您链接到的 IBM 文档中的内容相匹配 (https://www.ibm.com/docs/en/szs/2.2?topic=effects-command-audit-trail),那么您需要做什么在捕获输出之后,只需丢弃前两行(应该是):(

Command Audit Trail for USER IBMUSER
 

一行文本和一个空行)。

您可以按如下方式执行此操作:

y = outtrap('temp.')
    address tso 'RLIST CLASSX CLASSX.RESOURCE.LIST'
y = outtrap('off')

/* Copy from the 3rd command response line into our 'real' response var */
do tempIndex = 3 to temp.0
   desiredIndex = tempIndex - 2
   resourceAccess.desiredIndex = temp.tempIndex
end
resourceAccess.0 = temp.0 - 2 /* Set number of lines */

It's possible that those lines of text are being issued in such a way that they cannot be trapped using outtrap and are instead being placed on the external data queue (EDQ) and then echoed to the terminal when the REXX exits. ACF2 does this with all output, making trapping command responses a bit tricky.

Try this:

/* Trap command response*/
y = outtrap('temp.')
    address tso 'RLIST CLASSX CLASSX.RESOURCE.LIST'
y = outtrap('off')

/* Display anything put onto the EDQ */
do queued()
   pull line
   say line
end

Old answer:
If the output you are getting matches what's in the IBM docs you linked to (https://www.ibm.com/docs/en/szs/2.2?topic=effects-command-audit-trail), then what you need to do is after to have trapped the output, simply discard the first 2 lines, (which should be):

Command Audit Trail for USER IBMUSER
 

(one line of text and a blank line).

You could do this as follows:

y = outtrap('temp.')
    address tso 'RLIST CLASSX CLASSX.RESOURCE.LIST'
y = outtrap('off')

/* Copy from the 3rd command response line into our 'real' response var */
do tempIndex = 3 to temp.0
   desiredIndex = tempIndex - 2
   resourceAccess.desiredIndex = temp.tempIndex
end
resourceAccess.0 = temp.0 - 2 /* Set number of lines */
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文