Hi ,
Thanks for sharing this on the forum , I was redirected here from the Elastic forum and was interested in trying this out .
I was able to run the CFDictionaries script without any issues and pull the zones from my organization ID. But the other script for pulling CFlogs and audit logs keeps throwing error.
Here is the error I'm getting on PS :
Based on the number of api calls it is making , it looks like it is reaching all my zones under the org ID , but keeps pointing to the Invoke-RestMethod under errors. Is there something I'm missing here ? Appreciate any insight you could give me on this ? Thanks in advance.
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
At C:\Users\anthonyp\Downloads\ElasticFlare-master\ElasticFlare\logstash\scripts\CFLogPull.ps1:55 char:10
-
$R = Invoke-RestMethod @A "https://api.cloudflare.com/client/v4/z ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand