liquirice/qelastic

A Laravel Service Provider push user behavior log to Aws sqs then insert into elasticsearch
13 1
Install
composer require liquirice/qelastic
Latest Version:v1.0.0
PHP:>=5.3.0
Last Updated:Dec 9, 2015
Links: GitHub  ·  Packagist
Maintainer: liquirice

#Qelastic

Latest Stable Version License MIT

A Laravel Service Provider push user behavior log or any log to Aws sqs. Using php artisan queue:listen to digest the queue and insert data into elasticsearch.

Installation

Install using composer:

$ composer require liquirice/elasticlog
$ composer install

Install manually in composer.json:

"require": {
    ...
    "liquirice/qelastic": "~1.0.0"
    ...
},

Laravel (optional)

Add the service provider in app/config/app.php:

'providers' => array(
    ...
    Liquirice\Qelastic\QelasticServiceProvider::class,
    ...
)

We have already added the Qelastic alias for you:

'aliases' => array(
    ...
    'Qelastic' => 'Liquirice\Qelastic\Facades\Qelastic',
    ...
)

Environment setting

Add the elasticsearch hostname and queue path in .env:

...
ELASTICSEARCH_HOST=127.0.0.1:9200
QUEUE_PATH=App\Jobs\Track\UserBehavior
...

Basic Usage

Start by creating an Qelastic instance (or use the Qelastic Facade if you are using Laravel):

Qelastic::pushToQueue(array(
    'user_id' => '1',
    'action' => 'click',
    'object' => 'event',
    'object_id' => '50786',
    'param' => '{
        "user_name": "admin",
        "email" : "admin@example.com"
    }'
))

Note: Test case not yet finish

  1. Check input data is array or not.
  2. Test unexpected data insert.
  3. Check data whether push to queue or not.

License

Qelastic is licensed under The MIT License (MIT).

Related Packages

erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

628,058,007 9,707
laravel/framework

The Laravel Framework.

576,155,700 34,907
laravel/tinker

Powerful REPL for the Laravel framework.

485,678,092 7,440