[rudder-users] help on "multiple line edits to one file"

Nicolas Charles nicolas.charles at rudder.io
Wed Nov 20 16:45:26 CET 2019


Tim,

The underlying issue comes from the non-evaluation of ${match.xxx} 
outside of a replacement part; in our case for the reporting information

We created a workaround in the generic method in ticket 
https://issues.rudder.io/issues/14286. You can either apply the patch 
directly on your system in /usr/share/ncf/tree/, that will be propagated 
to all nodes, or wait for the upcoming 5.0.15 with the correction included

I'm sorry for this issue that we did not correctly assessed, and I thank 
you again for your detailed issue report

Nicolas

On 20/11/2019 12:26, Nicolas Charles wrote:
> Tim,
>
> Thank you for this report. I was able to reproduced it, by defining 
> variables es_wazuh_shards & es_wazuh_replicas
>
> This is an subcase of https://issues.rudder.io/issues/14286, and we 
> didn't correctly assessed that it would prevent multiple reporting 
> from same generic method.
>
> We are working on a solution/workaround
>
> Nicolas CHARLES
>
> On 19/11/2019 22:47, tim taler wrote:
>> I struggle with multiple line edits in one file.
>>
>> I would need to edit several lines in a json file.
>>
>> While the editing through "File replace lines"
>> actually works (I need to preserve leading whitespaces,
>> brackets, quotes etc.)
>> all but the the first editing is showing as "Missing" in the reports.
>> (multiple file editing with "file key-valule present" on another file
>> works fine, but I think can't use that in this case)
>>
>> Any Idea how to approach this (other than changing the file into a 
>> template
>> and doing it through template expansion?)
>>
>> The actual file would be:
>>
>> /usr/bin/curl 
>> https://raw.githubusercontent.com/wazuh/wazuh/v3.10.2/extensions/elasticsearch/7.x/wazuh-template.json
>> -o /etc/kibana/wazuh-elastic-template.json
>>
>> than three replacements:
>>
>> (\s+.order.: )(?!(1))([0-9]*)(.*)
>> with
>> ${match.1}1,
>>
>> (\s+.index.number_of_shards.: .)(?!(${es_wazuh_shards}))([0-9]*)(.*)
>> with
>> ${match.1}${es_wazuh_shards}${match.4}
>>
>> and
>> (\s+.index.number_of_replicas.: .)(?!(${es_wazuh_replicas}))([0-9]*)(.*)
>> with
>> ${match.1}${es_wazuh_replicas}${match.4}
>>
>> TIA
>>
>> _______________________________________________
>> rudder-users mailing list
>> FAQ: https://faq.rudder.io/
>> Bug Tracker: https://issues.rudder.io/
>> rudder-users at lists.rudder-project.org
>> https://www.rudder-project.org/mailman/listinfo/rudder-users
>
> _______________________________________________
> rudder-users mailing list
> FAQ: https://faq.rudder.io/
> Bug Tracker: https://issues.rudder.io/
> rudder-users at lists.rudder-project.org
> https://www.rudder-project.org/mailman/listinfo/rudder-users


More information about the rudder-users mailing list