How I can run jdbc_streaming filter just one time on multiple jdbc plugin row results

Hi.
I want to run jdbc_streaming filter plugin just one time on multiple jdbc plugin row results.

For example,
I set jdbc input plugin in pipeline, and It return 10 table rows.

input{
  Jdbc{
     #jdbc settings
     Statement => “SELECT * FROM TABLE WHERE ROWNUM <= 10”
     #This jdbc plugin return 10 rows
  }
}

Also I set jdbc_streaming filter like below.
This jdbc_streaming run 10 times. I think filter plugin run following input plugin results for editing them.

filter{
  Jdbc_streaming{
    #jdbc settings
      statement => “DELETE FROM TABLE WHERE reg_time<SYSDATE”
    #runnint 10 times because input plugin return 10 rows
  }
}

In this situation, I want to run jdbc_streaming filter just one time even though input plugin get many rows(events).(I plan to use jdbc_streaming only one time for removing rows which I selected by jdbc input plugin)

Please give me advises.
and I hope you have always good days.

Thank you.

Hi,

I think the best way would be to select rownum and add a conditional to only execute the streaming filter once(untested code):

filter{
  if [rownum] == 1 {
    Jdbc_streaming{
      #jdbc settings
      statement => “DELETE FROM TABLE WHERE reg_time<SYSDATE”
      #runnint 10 times because input plugin return 10 rows
    }
  }
}

Best regards
Wolfram

1 Like

Hi.
Thanks to your solution, I could solve my problem.

Thank you so much again :D!

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