阿里云cdn 日志收集脚本

科技资讯

阿里云的cdn在网页端是有热点分析效果不错,但是对于分散的url比如一个目录的一组图片是无法简单从热点中发现的。需要从日志里想办法分析

思路

[password key=janesi]curl ‘https://cdn.console.aliyun.com/console/v2/data/describeCdnDomainLogs.json?domainName=yun.janesi.com&logDay=2018-09-28’ -H ‘accept-encoding: gzip, deflate, br’ -H ‘accept-language: zh-CN,zh;q=0.9’ -H ‘user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36’ -H ‘accept: */*’ -H ‘referer: https://cdn.console.aliyun.com/’ -H ‘authority: cdn.console.aliyun.com’ -H ‘cookie: cna=eDKdE2LSUCsCATy/R7IBZgd7; cnz=HifXE1RsPFwCAbJHvzxxqbC7; _ga=GA1.2.534605534.1531984157; l=Al1dbZgsjjgnVhPz3RHStGqr7TJXdZHM; aliyun_choice=CN; UM_distinctid=164cf990246206-0ab7e4ed5e90de-5b193413-1fa400-164cf990247830; sidebarType=mini; CLOSE_HELP_GUIDE=true; login_aliyunid_pk=1186710886789908; login_aliyunid_token=”0pjgdzlQWXr/uR65AYIqMn+7BRULA/wQlLY1EIspjRY=”; _uab_collina=153559577955745603540056; channel=zIs5C5LHuGNyBbwQAnFn4lqLYwoZxnMo6uODPrSJCC0%3D; login_aliyunid_pks=”IV+YZQSEbmQY8QOyQly11FyKVg8A40DKALWSz9qcaMxqP0=”; aliyun_country=CN; aliyun_site=CN; aliyun_lang=zh; login_aliyunid_csrf=fb621a2eb60c427fb8da6df5632ee800; login_aliyunid=”chenyipeng @ 1186710886789908″; login_aliyunid_ticket=RUi1XGV1OP_lz3Mi5dp46CgPlTCEmQ2dFcqToNDOoagfq1S1E2ml6JYlY4q9CyLstMknfiSc2GhOwNcWzj5bYLpKzKZ49O80KpzxYXWJ0WPzFXDzr7rhZ_Dua5Qyv2KMv85szYAdhP4$; login_aliyunid_sc=74u48x24xL7xCj1SQ9*cYL0T_GM6j755wnVOTAxnxEubBJDKnxgsXxcXToH8WAsDRLgxkbhKjaF5mr_rpfZXqXDWTDEBUrt_0jXnTKaoslOXYQhG1shU4g$$; _HOME_JSESSIONID=P1666H81-NYIY8QQWUTOBRGR64F1Z1-9WPERMMJ-FD0A; _home_session0=AtIYsOFhqW6gAH3w3KyINw%2B0nkx3fgTzHtApWvnRQaKICp2MLVzZgChTd37qJK3otIDTEM70G8YTl8yPqCBjM%2Bbl0EnS8jGZutLfHc%2FI2VM0c9s2Ytq4%2B9Hm8aXN1mogiQT79Vknp79slhemjiYC1isINpn9q1DChHS2EEp%2Bx3gSqEH1RyVo%2FSsGI29vPJnDdVCDeDPGDT6tdQJjcUk%2B5bsT1dl6T4jygDMVQJSGTYKbKnwGNV%2B8OQQwVe1L0XBTMwcez4lTntPzZg%2Fu5eIKb2b8mytCtusn3RhssHAUz2Ger4vmFAwM2q2Gjc7MphGMinbcvnjVO5m%2BV%2BLTsqUckQ%3D%3D; consoleNavVersion=1.4.125; ONE_NEW_JSESSIONID=Q26661B1-5G1ZCDN8P7Z6K072HSTR1-XHUERMMJ-8S2; _one_new_session0=8WxT4FPCm95rLxBzR%2FJLmUvNhDowXEodZhbApWqNvKYAOLWdq7XwG29MYshm%2F%2F9cguID5%2B0Lc7J2We2EnmidlOuHVqRM68l8uGQsBfODkM6%2Ft6Vb7lfQmiRng4dlY6nIZhfZMxQ61lhREp9NuWSQemJpL%2BjjvHgc%2FbQREY28oeqGIc2sKbDZfEC4Kf24qcXJTV51VWrDm%2BkKM1%2FRs0jgnPH5yvfbWgBMsXhFrdutSn6w65U8b4kLnUK75Jyu3bbBmo2BRYgGY5D9XU1PTslh8hart97gMhs%2BhJwTUBliB05oqpSuWJOHtgBcsnxec5cLinbcvnjVO5m%2BV%2BLTsqUckQ%3D%3D; currentRegionId=cn-shanghai; activeRegionId=cn-shanghai; JSESSIONID=T1666Q91-2G0ZI5DLON00E33HOURE2-D8UGRMMJ-MG1; _cdn_session0=AtIYsOFhqW6gAH3w3KyIN4MqgWGZ19itW2SztAYifcQpmGTiWZP%2BeYVRoSfEiFDlXQDPhgX5eOqjLftiZdP9z6XgBGLEO12CwgYHOur%2Fkw119fISX1TE9sc2IohIctuQBxi4UaVM4U8Zjgx8eeaWHAFVaVTLOqRgqFlG%2BATT5k2l8UrQHrC64%2BQ0%2BoyiuiYW3ZqYectqpoCy5Gs%2FeJsmw0KLZf5jdmyqUAiYXNiKjcJbDjojfmUrc6uzn3OWR7XkX3g9r4uxn7lG%2FandTBjKdPA6ztJ3mNJoKl7Cu%2BbRN0TTbnm%2FgVEOe9GtXk5iknLu; consoleRecentVisit=cdn%2Cdds%2Cecs%2Celasticsearch%2Crds; _umdata=0823A424438F76AB260715F72D85730F0ABB7060A2E42D539702C246AD6787AD001FDABDC8245DBECD43AD3E795C914C7C9D75CC2A4D5CB536FB28811276905F; isg=BF5eqFzmiSc-Ed09AXJtVCM6r_SqFSkdbmb8YQju-qHPK-MFcaxiqP-NJ3eCExqx’ –compressed[/password]

curl ‘https://cdn.console.aliyun.com/console/v2/data/describeCdnDomainLogs.json?domainName=yun.janesi.com&logDay=2018-09-28’ -H ‘accept-encoding: gzip, deflate, br’ -H ‘accept-language: zh-CN,zh;q=0.9’ -H ‘user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36’ -H ‘accept: */*’ -H ‘referer: https://cdn.console.aliyun.com/’ -H ‘authority: cdn.console.aliyun.com’ -H ‘cookie’

下载 依次cat > 导出到一个文件中

 

继续阅读