How to use hierarchical group in apache usergrid? - apigee

According to usergrid documentation -
Groups are hierarchical. Every member of the group /groups/california/san-francisco is also a member of the group /groups/california
(https://usergrid.apache.org/docs/user-management/group.html)
Based on above concept I have created two groups -
Group1 /california/san-francisco has users - user1, user2
and Group2 /california has users - user3, user4.
Based on usergrid documentation I am expecting that user1 and user2 should also be members of Group2 but they are not(if I am hitting url - /groups/california/users, it only returns user3 and user4, Should not it also return user1 and user2?)
Also I have posted an activity in Group2 /california which is appearing in feeds of users of Group2 i.e. - user3, user4, but not appearing in the feed of Group /groups/california/san-francisco users i.e. - user1, user2.
What am I doing wrong? Please suggest.

Related

How to send email alert to groups based on condition success using Kibana Rules

I have created a rule using Kibana rules, by following the below steps:
Created a new rule by selecting "Rule" under the "Security" section
Then selected the rule type as "Event Correlation", wherein I added the index pattern and wrote the EQL (which included the where condition to include the events)
Added the required fields in the Action section, and then saved the rule.
I am getting the email alerts based on the condition written, but the alerts are such that:
Suppose a single mail contains the below content -
ClientName: ABC
HostName: ABC
ClientName: ABC
HostName: ABC
ClientName: DEF
HostName: DEF
But I want to group the mail so that each mail should have data related to only 1 clientName. As in this case email should have contained data of only those clients whose name is ABC
Whereas the data of clientName DEF, should be sent in a different mail.
Is there a way to achieve this type of grouping based on the clientName? This similar situation can be done using watcher as given in this answer, but can anyone please let me know what the ideal way to do that in my case ?

How to query Gremlin when multiple connections between nodes are present

I'm trying to build a suggestion engine using Gremlin but I'm having a hard time trying to understand how to create a query when multiple nodes are connected by different intermediate nodes.
Playground:
https://gremlify.com/alxrvpfnlo9/2
Graph:
In this simple example I have two users, both like cheese and bread. But User2 also likes sandwiches, which seems a good suggestion for User1 as he shares some common interests with User2
The question I'm trying to answer is: "What can I suggest to User1 based on what other users like?"
The answer should be: Everything that other users that like the same things as User1 likes, but excluding what User1 already like. In this case it should return a sandwich
So far I have this query:
g.V(2448600).as('user1')
.out().as('user1Likes')
.in().where(neq('user1')) // to get to User2
.out().where(neq('user1Likes')) // to get to what User2 likes but excluding items that User1 likes
Which returns:
Sandwich, bread, Sandwich (again), cheese
I think that it returns that data because it walks through the graph by the Cheese node first, so Bread is not included in the 'user1Likes' list, thus not excluded in the final result. Then it walks through the Bread node, so cheese in this case is a good suggestion.
Any ideas/suggestions on how to write that query? Take into consideration that it should escalate to multiple users-ingredients
I suggest that you model your problem differently. Normally the vertex label is used to determine the type of the entity. Not to identify the entity. In your case, I think you need two vertex labels: "user" and "product".
Here is the code that creates the graph.
g.addV('user').property('name', 'User1').as('user1').
addV('user').property('name', 'User2').as('user2').
addV('product').property('name', 'Cheese').as('cheese').
addV('product').property('name', 'Bread').as('bread').
addV('product').property('name', 'Sandwiches').as('sandwiches').
addE('likes').from('user1').to('cheese').
addE('likes').from('user1').to('bread').
addE('likes').from('user2').to('cheese').
addE('likes').from('user2').to('bread').
addE('likes').from('user2').to('sandwiches')
And here is the traversal that gets the recommended products for "User1".
g.V().has('user', 'name', 'User1').as('user1').
out('likes').aggregate('user1Likes').
in('likes').
where(neq('user1')).
dedup().
out('likes').
where(without('user1Likes')).
dedup()
The aggregate step aggregates all the products liked by "User1" into a collection named "user1Likes".
The without predicate passes only the vertices that are not within the collection "user1Likes".

Drupal 8 webform: How can multiple users add score to the same submission (eg: exam)?

Ho can two or more users add score to a single webform submission ?. Any exist solution available ?.
I have a webform called exam contain (Name, Email and some questions, Score(1->10)). The problem here when the user 1 add score (8), the user 2 see the same value (8), so when he update the score field (8) to (10). The value (8) will be deleted.
I want that the field be availble for each users ( instance). By this way, the user 1 can add (8), the user 2 can add (10) without loosing the two values. Admin can see the submission with the two scores value. Admin can associate many users to evaluate submission and add score.(This is the point)

Custom Groups in Google Data Studio

In Google Analytics I have a custom dimension C-Age capturing age (since Google themselves are not able to automatically capture this on every visitor). In data studio I would like to aggregate this now in age groups: 18-24 / 25-34 / 35-44/ 45-54 / 55-65 / 65+
However, I seem to be unable to count instances of a metric by dimension. I have the metric users on my custom dimension C_Age.
I have tried this with CASE / WHEN but haven't been able to get the formula working. Any suggestions?
Set the aggregation method for C-Age to None in the Fields screen.
Create a calculated field using CASE / WHEN to set the proper bins for age groups.
If you want to count instances, you can just add another calculated field Visitor Count with the formula 1+0 or do a unique count on any unique identifier you might have.
This should solve your issue.

Can any one help me in writing a script for the following scenario

I have the following scenario.
I have a file with the following content.
start-I/p end-I/p code
10.35.210.1 10.35.210.255 User1
10.35.145.1 10.35.145.255 User2
I want the output in the following manner.
ip code
10.35.210.1 user1
10.35.210.2 user1
10.35.210.3 user1
10.35.210.4 user1
and so on until
10.35.210.255 user1
10.35.145.1 user2
10.35.145.2 user2
10.35.145.3 user2
10.35.145.4 user2
so on till
10.35.145.255 user2.
Can any one help me with a suitable solution?
You could use python its a matter of only two loops.convert IP to integer [Conversion from IP string to integer, and backward in Python, increment it and print it along with the user
Thats it

Resources