-
Notifications
You must be signed in to change notification settings - Fork 73
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
get_entry_matching_value does not handle ignore-case properly. #648
Comments
@haiqi96 I saw this issue with no one assigned, and thought I would try to develop a fix (this one). I chose to keep the boolean parameter |
@aestriplex Thank you very much for developing the fix. The vector apporach makes sense to me. One potential way to fix this is to use an imprecise var instead of a precise var. Unfortunately I am very busy this week so won't have time to dive down into details. Can you investigate first and let me know if you have any question or concern? |
Thanks @haiqi96. Yes, I will investigate and try to fix it on my own. I'll let you know |
@haiqi96 I changed the implementation of the LogTypeDictionaryEntry::add_dict_var(logtype); and sub_query.add_imprecise_dict_var(encoded_vars, entries); are called just once now. teo@Mac build % ./clg -i /out_log "My custom log two var1 num"
/log/test.log:2024-12-03 12:06:37.096 My custom log two var1 num 12(StaticText)
/log/test.log:2024-12-03 12:06:37.096 My custom log two VAR1 num 12(StaticText)
/log//test.log:2024-12-03 12:06:37.096 My custom log two VaR1 num 12(StaticText) Tomorrow I'll implement a new section in |
@haiqi96 REQUIRE(var_dict_reader.get_entry_matching_value("string_not_present_in_var_strs", true).empty());
REQUIRE(var_dict_reader.get_entry_matching_value("string_not_present_in_var_strs", false).empty()); If it is okay with you, I will open a pull request with this issue linked |
Sorry, was dragged into some work today, I will closely look at your change tomorrow, as long as no unexpected task comes up. |
Bughttps://github.com/y-scope/clp/issues/new/choose
Our current implementation of get_entry_matching_value() assumes only 1 value in the dictionary will match the input string.
This assumption is correct when match is case_sensitive (since the the input value won't contain wildcard).
However, when ignore_case is switched on, it's possible more than one dictioanry variables will match the input value. (for example, all of "VAR1", "var1" and "vAr1") matches input "var1", but only one of them will be returned.
As a result, CLP won't return matching messages with the other variables.
I believe the proper fix to this issue is to ether:
CLP version
329edf6
Environment
unrelated to OS version.
Reproduction steps
./cmake-build-release/clg -i output/ "My custom log two var1 num"
test.log
The text was updated successfully, but these errors were encountered: