https://github.com/hrbrmstr/pgcidr
Perform IP Address in CIDR Lookups with PostgreSQL and ip4r
https://github.com/hrbrmstr/pgcidr
cidr ip ip4r postgresql r rstats
Last synced: 11 days ago
JSON representation
Perform IP Address in CIDR Lookups with PostgreSQL and ip4r
- Host: GitHub
- URL: https://github.com/hrbrmstr/pgcidr
- Owner: hrbrmstr
- License: other
- Created: 2020-05-13T10:31:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-30T17:33:41.000Z (over 4 years ago)
- Last Synced: 2025-03-27T02:43:33.552Z (28 days ago)
- Topics: cidr, ip, ip4r, postgresql, r, rstats
- Language: R
- Homepage: https://cinc.rud.is/web/packages/pgcidr/
- Size: 36.1 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - hrbrmstr/pgcidr - Perform IP Address in CIDR Lookups with PostgreSQL and ip4r (R)
README
---
output: rmarkdown::github_document
editor_options:
chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
hrbrpkghelpr::global_opts()
``````{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
``````{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```## What's Inside The Tin
The following functions are implemented:
```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```## Installation
```{r install-ex, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::install_block()
```## Usage
```{r lib-ex}
library(pgcidr)# current version
packageVersion("pgcidr")```
```{r ex-01, eval=FALSE}
DBI::dbConnect(
odbc::odbc(),
driver = "/usr/local/lib/psqlodbca.so",
Database = "working",
Host = "localhost"
) -> concreate_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"
)## # A tibble: 83 x 3
## ip entity cidr
##
## 1 54.235.230.238 us-east-1 54.234.0.0/15
## 2 54.227.107.78 us-east-1 54.226.0.0/15
## 3 96.127.69.213 us-gov-west-1 96.127.0.0/17
## 4 3.82.223.254 us-east-1 3.80.0.0/12
## 5 3.83.153.45 us-east-1 3.80.0.0/12
## 6 54.160.105.136 us-east-1 54.160.0.0/13
## 7 54.225.41.245 us-east-1 54.224.0.0/15
## 8 3.87.18.119 us-east-1 3.80.0.0/12
## 9 54.91.31.71 us-east-1 54.88.0.0/14
## 10 54.90.66.13 us-east-1 54.88.0.0/14
## # … with 73 more rows
```## pgcidr Metrics
```{r cloc, echo=FALSE}
cloc::cloc_pkg_md()
```## Code of Conduct
Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms.