SOLVED: Logstash: how to expand numeric ranges? eg. 1-5 → 1 2 3 4 5


#1

Hi, i'm trying to analyze aggregated information from slurm HPC scheduler, and need to expand ranges like
n[1-3,10-11] to n1,n2,n3,n10,n11.
Could it be done with some existing filter?


(Magnus Bäck) #2

No, you'll have to use a ruby filter.


#3

thx, solved with ruby filter and nodeset from clustershell project:

#expand nodelist, when present:

if "slurm_nodelist" in [tags] {
  ruby {
    code => "slurm_nodelist=event.get('slurm_nodelist');expanded_nodelist=`nodeset -e #{slurm_nodelist}`; event.set('nodelist', expanded_nodelist)"
  }
}

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.