How can I use set_line_based to manage a space separated file like /etc/services but include more than one space to make the config a bit easier to read.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  bundle agent main
  {
    vars:

        "map[hpss_d_mvr1]" string => "65501/tcp";

       # Include padding in the value itself
        "map[hpss_d_mvr2]" string => "     65503/tcp";

    files:
        "/tmp/services"
          create => "true";

      # Use more than one space in the second field for the minimum number of
      # spaces between columns

        "/tmp/services"
          edit_line => set_line_based( "$(this.bundle).map", "  ", "\s+", ".*", ""  );
    reports:
      "$(sys.cf_version)";
      "/tmp/services"
        printfile => cat("/tmp/services");
  }
R: 3.11.0
R: /tmp/services
R: hpss_d_mvr2       65503/tcp
R: hpss_d_mvr1  65501/tcp