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

Return complete string tokens in eventformatter #1047

Merged
merged 1 commit into from
Feb 5, 2018
Merged

Conversation

mattpag
Copy link
Contributor

@mattpag mattpag commented Jan 19, 2018

Directly use the string token to get the complete filtercheck in the format string instead of just using the filtercheck field info.
This way indexes/arguments will be reported too (e.g. proc.aname[2] instead of only proc.aname)

@mattpag mattpag requested review from luca3m and mstemm January 19, 2018 16:02
Copy link
Contributor

@mstemm mstemm left a comment

Choose a reason for hiding this comment

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

Just the question about deleting the check.

@@ -151,8 +154,7 @@ void sinsp_evt_formatter::set_format(const string& fmt)
if(last_nontoken_str_start != j)
{
sinsp_filter_check * chk = new rawstring_check(lfmt.substr(last_nontoken_str_start, j - last_nontoken_str_start));
m_tokens.push_back(chk);
m_chks_to_free.push_back(chk);
m_tokens.emplace_back(make_pair("", chk));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you need to add chk to m_chks_to_free ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, I didn't meant to delete that line!

Directly use the string token to retrieve the filtercheck used in the
format string instead of just using the filtercheck field info.
This way indexes/arguments will be present inside the key.
@mattpag mattpag merged commit a9a697e into dev Feb 5, 2018
@mattpag mattpag deleted the export-complete-token branch February 5, 2018 17:19
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.

3 participants