Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include host name as a pivot point in Kestrel query #466

Open
Galal-sec opened this issue Jan 19, 2024 · 1 comment
Open

Include host name as a pivot point in Kestrel query #466

Galal-sec opened this issue Jan 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Galal-sec
Copy link

Is your feature request related to a problem? Please describe.
I have a use case to get the sequence of commands execution from the same host within timestamp

Describe the solution you'd like
Correlate sequence commands on the same host

Describe alternatives you've considered
If we can do the same via Parent process ID

Additional context
image

@Galal-sec Galal-sec added the enhancement New feature or request label Jan 19, 2024
@pcoccoli
Copy link
Collaborator

For implementing simple correlation in SQL (which we're trying to leverage as much as possible in kestrel 2), consider a simple table mydata:

# select * from mydata;
 name  |       email       
-------+-------------------
 alice | [email protected]
 bob   | [email protected]
 carol | [email protected]
(3 rows)

Finding rows that share the same email could be done by with grouping:

# select * from mydata where email in (select email from mydata group by email having count(*) > 1);
 name  |       email       
-------+-------------------
 alice | [email protected]
 carol | [email protected]
(2 rows)

Another possibility is joins:

# select L.* from mydata L join mydata R on L.email = R.email where L.name != R.name;
 name  |       email       
-------+-------------------
 alice | [email protected]
 carol | [email protected]
(2 rows)

In postgres, the grouping method is less expensive according to the EXPLAIN output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants