censys_query: Issue SQL Queries against the Censys API

Description Usage Arguments Details Value References Examples

View source: R/sqlquery.r

Description

The Query API allows executing SQL queries against our daily snapshots and raw data analogous to the Query web interface. Queries are executed asynchronously. You must first start a job, then check its status. Once a job has completed, you can view paginated results using the get results endpoint. Jobs typically require 15-30 seconds to execute; results can be viewed for 24 hours after the job completed. Ddefinition endpoints are also exposed where you can list the series and view series details (i.e., list tables and schema).

Usage

1

Arguments

sql

SQL query string

Details

You must have both CENSYS_API_ID and CENSYS_API_SECRET present in the R environment for the functions in this package to work. It is highly suggested that you place those in ~/.Renviron at least for interactive work.

Value

API call result (invisibly)

References

Censys SQL query syntax: https://censys.io/query; API doc: https://www.censys.io/api/v1/docs/search

Examples

1
2
3
4
5
6
7
8
## Not run: 
q <- censys_query("SELECT p443.https.tls.cipher_suite.name, count(ip) FROM ipv4
                   WHERE p443.https.tls.validation.browser_trusted=true
                   GROUP BY p443.https.tls.cipher_suite.name;")
censys_get_job_status(q$job_id)
censys_get_job_result(q$job_id)

## End(Not run)

censys documentation built on May 2, 2019, 10:45 a.m.