If we can call API with designated cookie to retrieve the log before outputing to downstream in Filebeat

if we can call API with designated cookie to retrieve the log before outputting to downstream in Filebeat ?

Scenarios:

  1. My server have generated the first batch 1000 records log with cookie information
  2. I need to extract the cookie information in the first batch log
  3. Then I want to trigger a call to my endpoint in my application server with the extracted cookie to retrieve second batch log in filebeat, the what would be the solution ?