Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fluent-plugin-ipinfo

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluent-plugin-ipinfo

  • 1.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

fluent-plugin-ipinfo

Fluentd Filter plugin to add information about geographical location of IP addresses using the IPInfo API.

Installation

Install with fluent-gem or td-agent provided command as:

# For fluentd
$ gem install fluent-plugin-ipinfo
# or
$ fluent-gem install fluent-plugin-ipinfo

# For td-agent
$ sudo td-agent-gem install fluent-plugin-ipinfo

For more details, see Plugin Management

Example Configurations

<filter foo.bar>
  @type ipinfo
  access_token 1a2b3c4d5e
  key_name ip_address
  out_key ipinfo
  fields ["country_name", "region", "city", "latitude", "longitude"]
</filter>

In this example, the following event:

{
    "message":"Can you get me the geographical location for this IP addresse ?",
    "ip_address":"8.8.8.8"
}

would be enriched and returned as following:

{
    "message": "Can you get me the geographical location for this IP addresse ?",
    "ip_address": "8.8.8.8",
    "ipinfo": {
        "country_name": "United States",
        "region": "California",
        "city": "Mountain View",
        "latitude": "37.4056",
        "longitude": "-122.0775"
    }
}

Parameters

Common Parameters

access_token

typerequireddefault
stringfalsenil

The token to be used with the IPInfo API for paid plans. To use the free plan (limited to 50k requests per month), do not use the access_token parameter.

If the value provided for access_token is an empty string ("" or " "), the default value (nil) is used instead.

key_name

typerequireddefault
stringfalseip_address

The name of the key containing the IP address.

If the value provided for key_name is an empty string ("" or " ") or nil, the default value (ip_address) is used instead.

out_key

typerequireddefault
stringfalseipinfo

The name of the key to store the geographical location data in.

If the value provided for out_key is an empty string ("" or " ") or nil, the default value (ipinfo) is used instead.

If the record has already a key with the same name as the value of out_key, its value will be overwritten with the geographical location data as shown in the example below:

<filter foo.bar>
  @type ipinfo
  access_token 1a2b3c4d5e
  key_name ip_address
  out_key data
  fields ["country_name", "region", "city", "latitude", "longitude"]
</filter>

The following event:

{
    "message":"Can you get me the geographical location for this IP addresse ?",
    "ip_address":"8.8.8.8",
    "data": "This value is going to be overwritten."
}

would be enriched and returned as following:

{
    "message": "Can you get me the geographical location for this IP addresse ?",
    "ip_address": "8.8.8.8",
    "data": {
        "country_name": "United States",
        "region": "California",
        "city": "Mountain View",
        "latitude": "37.4056",
        "longitude": "-122.0775"
    }
}

fields

typerequireddefault
arrayfalse["country_name", "region", "city", "latitude", "longitude"]

The list of fields to fetch from IPInfo. The full list of fields is described in the official IPInfo API Ruby client.

Learn More

Copyright : Copyright (c) 2023 - Ahmed Abdelkafi License : Apache License, Version 2.0

FAQs

Package last updated on 10 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc