After doing suggested change in codec and xpath as below :
xpath => [
"/job_info/queue_info/job_list/@state", "Job_State",
"/job_info/queue_info/job_list/JB_job_number/text()", "Job_Number",
"/job_info/queue_info/job_list/JAT_prio/text()", "priority",
"/job_info/queue_info/job_list/JAT_ntix/text()", "ntix",
"/job_info/queue_info/job_list/JB_nppri/text()", "nppri",
"/job_info/queue_info/job_list/hard_req_queue/text()", "hard_req_queue",
"/job_info/queue_info/job_list/job_binding/text()", "binding",
"/job_info/job_info/job_list/@state", "Job_State",
"/job_info/job_info/job_list/JB_job_number/text()", "Job_Number",
"/job_info/job_info/job_list/JAT_prio/text()", "priority",
"/job_info/job_info/job_list/JAT_ntix/text()", "ntix",
"/job_info/job_info/job_list/JB_nppri/text()", "nppri",
"/job_info/job_info/job_list/hard_req_queue/text()", "hard_req_queue",
"/job_info/job_info/job_list/job_binding/text()", "binding"
]
When I keep auto_flush_interval => 2 then I get data for my <job_list state = running > tags as below
{
"host" => "myelkhost",
"@version" => "1",
"Job_State" => ,
"ntix" => [
[0] "0.00000",
[1] "0.00000"
],
"path" => "/usr/share/logstash/qstat.cache",
"priority" => [
[0] "0.00000",
[1] "0.00000"
],
"hard_req_queue" => [
[0] "all.q",
[1] "all.q"
],
"Job_Number" => [
[0] "133460680",
[1] "140091542"
],
"binding" => ,
"type" => "xml",
"nppri" => [
[0] "0.00000",
[1] "0.00000"
],
"@timestamp" => 2019-03-14T15:34:17.860Z,
"tags" => [
[0] "multiline"
],
"message" => "<?xml version='1.0'?>\n<job_info xmlns:xsd="https://schemas/qstat.xsd">\n <queue_info>\n <job_list state="running">\n <JB_job_number>148635539</JB_job_number>\n <JAT_prio>0.51090</JAT_prio>\n <JAT_ntix>1.00000</JAT_ntix>\n <JB_nppri>0.45090</JB_nppri>\n <hard_request name="mem_avail" resource_contribution="0.000000">400G</hard_request>\n <hard_req_queue>largemem.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n <job_list state="running">\n <JB_job_number>148711350</JB_job_number>\n <JAT_prio>0.51090</JAT_prio>\n <JAT_ntix>1.00000</JAT_ntix>\n <JB_nppri>0.45090</JB_nppri>\n <hard_request name="mem_avail" resource_contribution="0.000000">900G</hard_request>\n <hard_request name="h_rt" resource_contribution="0.000000">518400</hard_request>\n <hard_req_queue>largemem.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n </queue_info>\n <job_info>\n <job_list state="pending">\n <JB_job_number>133460680</JB_job_number>\n <JAT_prio>0.00000</JAT_prio>\n <JAT_ntix>0.00000</JAT_ntix>\n <JB_nppri>0.00000</JB_nppri>\n <hard_request name="mem_avail" resource_contribution="0.000000">1000M</hard_request>\n <hard_req_queue>all.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n <job_list state="pending">\n <JB_job_number>140091542</JB_job_number>\n <JAT_prio>0.00000</JAT_prio>\n <JAT_ntix>0.00000</JAT_ntix>\n <JB_nppri>0.00000</JB_nppri>\n <hard_request name="arch" resource_contribution="0.000000">lx*</hard_request>\n <hard_req_queue>all.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n </job_info>\n</job_info>"
and when i keep auto_flush_interval => i get data for my <job_list state = pending > tags as below
{
"nppri" => [
[0] "0.00000",
[1] "0.00000"
],
"tags" => [
[0] "multiline"
],
"type" => "xml",
"message" => "<?xml version='1.0'?>\n<job_info xmlns:xsd="https://schemas/qstat.xsd">\n <queue_info>\n <job_list state="running">\n <JB_job_number>148635539</JB_job_number>\n <JAT_prio>0.51090</JAT_prio>\n <JAT_ntix>1.00000</JAT_ntix>\n <JB_nppri>0.45090</JB_nppri>\n <hard_request name="mem_avail" resource_contribution="0.000000">400G</hard_request>\n <hard_req_queue>largemem.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n <job_list state="running">\n <JB_job_number>148711350</JB_job_number>\n <JAT_prio>0.51090</JAT_prio>\n <JAT_ntix>1.00000</JAT_ntix>\n <JB_nppri>0.45090</JB_nppri>\n <hard_request name="mem_avail" resource_contribution="0.000000">900G</hard_request>\n <hard_request name="h_rt" resource_contribution="0.000000">518400</hard_request>\n <hard_req_queue>largemem.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n </queue_info>\n <job_info>\n <job_list state="pending">\n <JB_job_number>133460680</JB_job_number>\n <JAT_prio>0.00000</JAT_prio>\n <JAT_ntix>0.00000</JAT_ntix>\n <JB_nppri>0.00000</JB_nppri>\n <hard_request name="mem_avail" resource_contribution="0.000000">1000M</hard_request>\n <hard_req_queue>all.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n <job_list state="pending">\n <JB_job_number>140091542</JB_job_number>\n <JAT_prio>0.00000</JAT_prio>\n <JAT_ntix>0.00000</JAT_ntix>\n <JB_nppri>0.00000</JB_nppri>\n <hard_request name="arch" resource_contribution="0.000000">lx*</hard_request>\n <hard_req_queue>all.q</hard_req_queue>\n <job_binding>NONE</job_binding>\n </job_list>\n </job_info>\n</job_info>",
"@timestamp" => 2019-03-14T15:43:54.868Z,
"host" => "myelkhost",
"@version" => "1",
"Job_State" => [
[0] "pending",
[1] "pending"
],
"binding" => [
[0] "NONE",
[1] "NONE"
],
"path" => "/usr/share/logstash/qstat.cache",
"hard_req_queue" => [
[0] "all.q",
[1] "all.q"
],
"priority" => [
[0] "0.00000",
[1] "0.00000"
],
"ntix" => [
[0] "0.00000",
[1] "0.00000"
],
"Job_Number" => [
[0] "133460680",
[1] "140091542"
]
}
But I do not get data for all the 4 running and pending status tags at same time.
I am running below command to test my pipeline
/usr/share/logstash/bin/logstash -f /usr/share/logstash/xml-pipeline.conf_ask --config.reload.automatic --path.settings /etc/logstash --path.data /usr/share/logstash/qcache/data