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

Feature request: Pull multiple fields instead of just one #5

Closed
deejross opened this issue May 23, 2017 · 3 comments
Closed

Feature request: Pull multiple fields instead of just one #5

deejross opened this issue May 23, 2017 · 3 comments
Milestone

Comments

@deejross
Copy link

It would be nice if we could provide it a list of fields we want it to return, possibly as a separate function to maintain backwards compatibility. I have lookup data that has many fields for a single ID and I'm currently having to make multiple slookup calls to get them all.

@billmurrin
Copy link
Owner

@deejross. Sorry for the lack of response on your comment. I definitely think we can do this. Kind of been working on another project as of late and haven't had time to work on this or the next version just yet. :-)

@billmurrin billmurrin added this to the 2.0.0 milestone Jan 14, 2018
@billmurrin
Copy link
Owner

@deejross - Incredibly sorry for the delay. Finally working this one into the codebase. Should be done soon.

@billmurrin
Copy link
Owner

billmurrin commented Jan 16, 2018

Changes to support multiple return fields have been merged into develop branch. One more bug fix and will release version 2.0.0.

Here's an example of how it will work:

rule "Log Enrichment - Descending"
when
    has_field("winlogbeat_computer_name")
then
    //StreamID, Source Field, Destination Field, Return Field(s), Relative Time, Ascending SortOrder
    let system_info = slookup("5a5d8854315d00059dbea98f", "winlogbeat_computer_name", "computer_name", ["ip_address","operating_system","mac_address"], "300", "desc");
    set_field("ip_address", system_info[0]);
    set_field("operating_system", to_string(system_info[1]));
    set_field("mac_address", system_info[2]);
end

To return a single field, just surround it in a list:

slookup("5a5d8854315d00059dbea98f", "winlogbeat_computer_name", "computer_name", ["ip_address"], "300", "desc");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants