jq is useful to slice, filter, map and transform structured json data.
brew install jq
| <# | |
| .SYNOPSIS | |
| An MTR clone for PowerShell. | |
| Written by Tyler Applebaum. | |
| Version 2.1 | |
| .LINK | |
| https://gist.github.com/tylerapplebaum/dc527a3bd875f11871e2 | |
| http://www.team-cymru.org/IP-ASN-mapping.html#dns |
This is a mix between two sources:
basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts
Basically the idea there is:
| # Conversion of http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTsearch#search.2Fjobs.2Fexport | |
| # example using curl, to PowerShell with Invoke-RestMethod cmdlet | |
| # | |
| # $ curl -k -u admin:changeme https://localhost:8089/services/search/jobs/export | |
| # --data-urlencode search="search index=_internal | stats count by sourcetype" | |
| # -d output_mode=json -d earliest="rt-5m" -d latest="rt" | |
| $cred = Get-Credential | |
| # This will allow for self-signed SSL certs to work |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000