Giter VIP home page Giter VIP logo

libbeat-php's Introduction

libbeat-php

Use this library to build a beats in PHP, implements lumberjeck 2 protocol. Supports compression and TLS

How to use?

To use this library you only need to add it to your composer file running:

composer require berni69/libbeat

Once installed, you can send a "beat" as follows:

<?php
require __DIR__.'/vendor/autoload.php';

use libbeat\BeatSender;
$beat = new  BeatSender('192.168.26.12', 5044);
$beat->send("test_log");
$beat->set_compression_rate(0);
$beat->send(["test_log2", "test_log3"]);

To use TLS/SSL you must pass the context options (http://php.net/manual/en/context.ssl.php) to the BeatSender constructor as follows:

<?php
$options = array(
             "ssl" => array(
                 "local_cert"        => $MYCERT,
                 /* If the certificate we are providing was passphrase encoded, we need to set it here */
                 "passphrase"        => "My Passphrase for the local_cert",
         
                 /* Optionally verify the server is who he says he is */
                 "cafile"            => $SSL_DIR . "/" . $SSL_FILE,
                 "allow_self_signed" => false,
                 "verify_peer"       => true,
                 "verify_peer_name"  => true,
                 "verify_expiry"     => true,
             ));
$beat = new  BeatSender('192.168.26.12', 5044, $options);

libbeat-php's People

Contributors

berni69 avatar monwolf avatar

Watchers

 avatar

Forkers

zxyfaxcn

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.