IBM webMethods Hybrid Integration

 View Only

 Searching on a custom HTTP header in API Gateway?

Garry Knight's profile image
Garry Knight posted Tue February 03, 2026 11:01 AM

Hi All,

Is there a way to search on a custom HTTP header in the API Gateway analytics?

Let's say I have 'nativeRequestHeaders.requestId' populated when you expand the details in the runtime events tab, how can I use that field to search for a specific request? 

Thank you!

Mayank Tripathi's profile image
Mayank Tripathi

Hi,

Yes, there is a way to implement this via Custom Extension policy.

The field(i.e. HTTP header in this case) needs to be added as custom variable and the value needs to be extracted using expression language based on if its REST/SOAP API.

  • Under Request processing->Custom Extension-->Custom Variables add the fields you want to use for filtering in the analytics
  • If you want to add field say 'BusinessKey1' for a SOAP API then it needs to be added as customTransactionFields.BusinessKey1 under Variable and its value extracted using XPATH
  • This custom variable then also needs to be added to the Elasticsearch where you are sending your analytics data and mapping needs to be created at index level
  • For e.g. if your transactional data resides on gateway_default_analytics_transactionalevents then use SOAPUI/Postman to create a mapping for the custom variable on the template associated with the index (eg. template_gateway_default_analytics_transactionalevents) Check out the screenshot i attached for creating a mapping for few fields at index level.

  • Now that field is added at index's template you can go to analytics section and use the filter on field customTransactionFields.BusinessKey1 to search. Another screenshot attached for reference.

Hope this helps.

Regards.

Garry Knight's profile image
Garry Knight

Thanks @Mayank Tripathi. Is this possible on the webmethods.io hosted API Gateway?

I have extracted a variable as below:

customTransactionFields.testSearch
${request.headers.x-test}

Is it possible to get this testSearch field now added to the .io hosted APIGW?

Thanks again.

Mayank Tripathi's profile image
Mayank Tripathi
I tested this approach on the local on-premise installation(10.15) where I have no access restrictions on both API gateway and external Elasticsearch(ES) instance used for storing analytics data(aka Analytics Datastore).
I haven't explored this yet on the .io hosted APIGW.
 
Having said that, you can in principle add the new custom variable into the index template using SOAPUI/POSTMAN if you have access to ES hosting your analytics data. You can refer the screenshot for sample request in my previous comment.
Let me know how it goes.
 
Regards,