Coder Social home page Coder Social logo

redisip's Introduction

RedisIP

RedisIP is a very simple Redis module with no registered commands. The only functionality introduced by the module is that is logs the IP address and hostname of the Redis instance to the redis log.

Note: This relies on the fact that the machine where a redis instances is started has entries for the hostname and related IP address in /etc/hosts

installation

Installation is simple and there are no dependencies other than CMake and a C compiler toolchain.

git clone <address>
cd RedisIP
mkdir build
cd build
cmake ..
make

This will create a shared library that can be loaded into a redis instance.

Usage

/path/to/redis-server --loadmodule /path/to/libredisip.so

Example Logging Output

The added output looks like the output pasted below.

30333:C 04 Mar 2021 15:39:33.158 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
30333:C 04 Mar 2021 15:39:33.158 # Redis version=6.0.8, bits=64, commit=03b59cd5, modified=1, pid=30333, just started
30333:C 04 Mar 2021 15:39:33.158 # Configuration loaded
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 6.0.8 (03b59cd5/1) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6780
 |    `-._   `._    /     _.-'    |     PID: 30333
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           http://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

30333:M 04 Mar 2021 15:39:33.159 # Server initialized
30333:M 04 Mar 2021 15:39:33.160 # <RedisIP> Hostname: nid00001
30333:M 04 Mar 2021 15:39:33.160 # <RedisIP> IP: 127.0.0.1
30333:M 04 Mar 2021 15:39:33.160 * Module 'RedisIP' loaded from ./libredisip.so
30333:M 04 Mar 2021 15:39:33.160 * Ready to accept connections

redisip's People

Contributors

spartee avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.