liquirice / qelastic
A Laravel Service Provider push user behavior log to Aws sqs then insert into elasticsearch
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/liquirice/qelastic
Requires
- php: >=5.3.0
- elasticsearch/elasticsearch: ~2.0
- illuminate/support: ~4|~5
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2025-10-25 23:26:58 UTC
README
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
- Check input data is array or not.
- Test unexpected data insert.
- Check data whether push to queue or not.
License
Qelastic is licensed under The MIT License (MIT).