github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/use.md (about) 1 ### `use()` {#fn-use} 2 3 函数原型:`fn use(name: str)` 4 5 参数: 6 7 - `name`: 脚本名,如 abp.p 8 9 函数说明:调用其他脚本,可在被调用的脚本访问当前的所有数据 10 示例: 11 12 ```python 13 # 待处理数据:{"ip":"1.2.3.4"} 14 15 # 处理脚本 a.p 16 use(\"b.p\") 17 18 # 处理脚本 b.p 19 json(_, ip) 20 geoip(ip) 21 22 # 执行脚本 a.p 的处理结果 23 { 24 "city" : "Brisbane", 25 "country" : "AU", 26 "ip" : "1.2.3.4", 27 "province" : "Queensland", 28 "isp" : "unknown" 29 "message" : "{\"ip\": \"1.2.3.4\"}", 30 } 31 ```