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

tim taler robur314 at gmail.com
Tue Nov 19 22:47:27 CET 2019


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


More information about the rudder-users mailing list