Description Usage Arguments Examples
View source: R/create-cidr-tbl.R
The columns named in entity_col and cidr_col must exist in the
data frame or CSV file. All _names must be valid PostgreSQL syntax for
said names. Setting drop=TRUE is destructive.
NOTE that cidr_col is a primary key. Thus duplicate CIDRs are not allowed
and it's up to you to ensure that.
1 2 3 4 5 6 7 8 | create_cidr_lookup_table(
pgcon,
tbl_name,
drop = FALSE,
xdf,
entity_col = "entity",
cidr_col = "cidr"
)
|
pgcon |
a PostgreSQL DBI connection |
tbl_name |
name of the CIDR table (valid PG table name syntax) |
drop |
drop existing CIDR table if it has the same name? Defaults to |
xdf |
Data frame to use to populate the table or a path to a CSV file.
If a path it will be |
entity_col |
Name of the column that holds the entity reference name for the CIDR |
cidr_col |
Name of the column that holds the CIDR block |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
DBI::dbConnect(
odbc::odbc(),
driver = "/usr/local/lib/psqlodbca.so",
Database = "working",
Host = "localhost"
) -> con
create_cidr_lookup_table(
pgcon = con,
tbl_name = "amazon_cidrs",
drop = TRUE,
xdf = system.file("extdat", "amzn-cidrs.csv", package = "pgcidr"),
)
create_ip_source_table(
pgcon = con,
tbl_name = "weblog",
drop = TRUE,
xdf = system.file("extdat", "weblog.csv", package = "pgcidr")
)
find_ips_in_cidrs(
con, "weblog", "amazon_cidrs"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.