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

filterx: add SDATA helper functions #242

Merged
merged 5 commits into from
Aug 30, 2024

Conversation

OverOrion
Copy link
Contributor

@version: 4.8
@include "scl.conf"

log {

  source { example-msg-generator(num(1)
    template("[Originator@6876 sub=Vimsvc.ha-eventmgr opID=esxui-13c6-6b16 sid=5214bde6 user=root][anotherSDID@32473 iut=4 eventSource=Application eventID=1012]")
  ); };
  parser{sdata-parser();};
  filterx {
    bar = has_sdata();
    foo = is_sdata_from_enterprise("6876");
    # asd = get_sdata();
    vars();
    };
  destination { file("/dev/stdout"); };
};

[2024-08-07T14:57:58.003231] Setting value; name='[email protected]', value='Vimsvc.ha-eventmgr', type='string', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] Setting value; name='[email protected]', value='esxui-13c6-6b16', type='string', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] Setting value; name='[email protected]', value='5214bde6', type='string', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] Setting value; name='[email protected]', value='root', type='string', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] Setting value; name='[email protected]', value='4', type='string', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] Setting value; name='[email protected]', value='Application', type='string', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] Setting value; name='[email protected]', value='1012', type='string', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] <<<<<< parser rule evaluation result; result='accepted', rule='#anon-parser0', location='/source/install_dir/etc/asd.conf:9:10', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] >>>>>> filterx rule evaluation begin; rule='#anon-filter0', location='/source/install_dir/etc/asd.conf:10:10', msg='0x59da85103170', rcptid='1872'
[2024-08-07T14:57:58.003231] FILTERX ESTEP; expr='/source/install_dir/etc/asd.conf:11:5|        bar = has_sdata()', value='true', truthy='1', type='boolean'
[2024-08-07T14:57:58.003231] FILTERX ESTEP; expr='/source/install_dir/etc/asd.conf:12:5|        foo = is_sdata_from_enterprise("6876")', value='true', truthy='1', type='boolean'

lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
bazsi
bazsi previously approved these changes Aug 7, 2024
Copy link
Member

@bazsi bazsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to see the new extract functions being used in the implementation, but it's approved from my part.

lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
@OverOrion OverOrion force-pushed the filterx-sdata-part1 branch 2 times, most recently from 0807326 to b273ebb Compare August 16, 2024 12:09
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
lib/filterx/func-sdata.c Outdated Show resolved Hide resolved
@jszigetvari
Copy link
Contributor

subscribe .

Copy link
Member

@alltilla alltilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature, thanks! :)

@alltilla alltilla merged commit dcc38fd into axoflow:main Aug 30, 2024
43 checks passed
fekete-robert pushed a commit to axoflow/axosyslog-core-docs that referenced this pull request Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants