PowerShell tips for calling CloudFlare SDK query site statistics _powershell

Source: Internet
Author: User
Tags cloudflare

CloudFlare is the world-famous CDN service provider, its free package is enough to meet the average user. Optimize the load speed of the website, cache the static resources, distribute the content near the local area to protect against the DDoS attack. In short, very good, very honest. But in the celestial many nodes are sealed, its own DNS was sealed, and Google and FB, the same as the end of the people (in fact, we are).

When I looked at CloudFlare's SDK, I found support for Windows platform support Invoke-webrequest, that is, PowerShell, just try to call down, sure enough.

For example, query the site's statistics:

$body = @{
a = ' stats '
tkn = ' 88190c6b06d12a8 '
email = ' mosser@pstips.net '
z = ' pstips.net
' interval =
 $cfResult =invoke-restmethod ' https://www.cloudflare.com/api_json.html '-body $body
 
 $ CfResult.response.result.objs.trafficBreakdown.uniques | Ft-autosize

The output is:

Regular threat crawler
--------------------
   4   29

Probably say: Regular visit 4 times, malicious attack 12 times, reptile visit 29 times.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.