Is it possible to configure custom queries in mqsql module of metricbeat - metricbeat

Is it possible to configure custom queries in mqsql module of metricbeat. I want to get the count of records in a particular table using metricbeat mysql module.
If this is not possible, is there a way to create a new metricset in mysql metricbeat module or create a custom module in metricbeat to do this? Anyone have any links that can help me in creating the custom module?

Related

Do Grails Domain Methods Create Mysql Triggers?

I can't seem to find this information anywhere. If I add domain methods to a grails domain class, are they set up as mysql triggers or do they just run in the project? Especially "default" triggers that have overlap like beforeUpdate or beforeInsert. There's no documentation on exactly how these methods are being set up.
No they do not. GORM does not create any triggers.

Elastic Search Implementation as a Microservice

I want to implement Elastic Search as a microservice. We would have 2 apps, where the main app will be connected to Relational Db and the other app will have all the logic for the Elastic search. Now, in the main app, any change would emit a unique event with the payload having all the relevant info around that change.
With the Elastic Search in place, the main app will send this event to the Elastic Search service to process. I am planning to have services for indexing each index table in elastic search. This service will process the event and make the addition/update/deletion based on the event in that index.
A single event can also be processed by multiple services if the index related to that service includes the data change related to that event.
I am just worried if this would be the right way to approach. I can see a single service(class) would grow huge with too many events being processed for indexing.
I would code this in ruby, and there is a gem called elasticsearch-model which is used by most people and is mentioned in every other blog. But I don't want to get restricted by that and also it would not be possible to use it in the kind of microservice setup.
Thanks in advance.
I used elasticsearch-model gem in my current web application you can override it's CRUD methods into your ruby code as used them as REST API Architecture
or
If you don't want to use this gem then you can also create REST api for your elasticsearch and implement your desired features.

Use ZFCUser in two Modules with different configuration

my Application has two modules. One for the main application (App) and one for backend administration (Admin).
For both I need an user management so I'd like to use ZFCUser. But I want to have different entities and database tables for the backend user (in the Admin module) and frontend user (in the App module). Also I need to set different configurations for the redirect rules.
When I configure e.g. "user_entity_class" in both module config files, it always will use the configuration of the last loaded module.
Has anybody an idea want could be an solution for that?
I'm happy about every proposal.
Update:
Unfortunately ACL is no solution because both user types are totally different. The entities have different (required) attributes and the workflows like the registration aren't the same.
You should only include ZfcUser ONCE.
If you want user roles like Admin you should look at ACL/RBAC.
There are modules which integrates with ZfcUser:
ACL: https://github.com/bjyoungblood/BjyAuthorize
RBAC: https://github.com/ZF-Commons/zfc-rbac

RoR: How to create a wrapper for a controller

I am new to Ruby on Rails. I am trying to integrate solr search engine with an RoR app. There is a controller in the app product_search_controller which uses the primitive search methods. I want to create a new controller for plugging in the solr serach engine.
I am planning to create a wrapper around product_search_controller to do that. What is the best way of creating the wrapper.
Thanks
Although there's a huge variety of options, I'd suggest the conventional way of using concerns: http://api.rubyonrails.org/classes/ActiveSupport/Concern.html
Rails 4 generates concerns directories by default. Basically, you'll just need to define all of the functionality inside your concerns/searchable.rb (example name) and include Searchable inside your controller

How to use zf2 ACL and auth storage in simplest form

Hi I need to use ACL in a situation where user can only login through third party service like facebook google etc and their are only two roles guest and user. Right now I am using \Zend\Authentication\Storage\Session() to store user object in session after authentication, but I don't want to apply checks on my every action to know the status of user. I want to keep it simple by using a simple access control list. I have checked many modules like zfcUser etc but they are far more complex than what I actually need. I tried to build my own ACL plugin but the documentation is not good enough and the tutorials on zf2 ACL are focusing on different cases.
Thanks in Advance for your help
Maybe this module can help:
BjyAuthorize
This module is designed provide a facade for Zend\Permissions\Acl that will ease its usage with modules and applications. By default, it provides simple setup via config files or by using Zend\Db or Doctrine ORM. This module also comes with out-of-the-box support for and integration with ZfcUser.

Resources