通过curl -s -n -k 'https://icinga.mycompany.com:5665/v1/objects/services/mls!elasticsearch-query-nginx-error-log' | jq -r '.results[0].attrs.notes_url'
,我从icinga2 API中获得了这些URL:
https://logs.mycompany.com/app/kibana#/discover?_g=(refreshInterval:(display:Off,pause:!f,value:0),time:(from:now-30d,mode:quick,to:now))&_a=(columns:!(level,severity,message),index:'production.production-mls',interval:auto,query:(language:lucene,query:'application:"mls" AND (facility:"mls.nginx.error" OR (facility:"mls.nginx.access" AND NOT http.response_code:[200 TO 399])) AND @timestamp:>now-15m AND NOT url_path:/\/test.*/'),sort:!('@timestamp',desc))
如何从命令行打开它?
我已经尝试过
URL=$(curl -s -n -k 'https://icinga.mycompany.com:5665/v1/objects/services/mls!elasticsearch-query-nginx-error-log' | jq -r '.results[0].attrs.notes_url')
open -a safari "$URL"
使用open
时,字符串经过URL编码,并且由于#
之后经过编码的kibana
而不再起作用。
我需要一种可以与其他复杂URL一起使用的解决方案。