General Notes About Searching/Filtering

  • There should be no spaces between the key and ‘=’ sign
    • * spaces after the ‘=’ are okay if it is querying a number field - if searching a string field, then this is invalid
  • When using the SORT on the Column labels, you must be on page 1 on the results to change the sort in the UI
  • Pagination stops returning results after about page 220 - use a better search to narrow down your results

Search By Status Codes

Examples:

afStatusCode=204
afStatusCode= 204,200


To return all Event documents that have a Status Code greater than 399 (so a 400, 500), the filter could be:

afStatusCode>399


Available Status Codes to search :

  • 200 - Success - Orchestration Init messages ("afAction" : "ORCHESTRATE", "afState" : "INIT")
  • 201- Created
  • 202 - success
  • 204 - No business documents found
  • 206 - more pages found
  • 400 - ERROR ("afState" : "ERROR")
  • 500 - RETRY ("afState" : "RETRY")


Search By Event Action

To search by afAction


Using commas, you can create an OR query with multiple values, but spaces are not trimmed since it is a full text search.


For example, you cannot have spaces around values when searching in primaryFile, since:

afAction=GET_SALESORDER,PUT_SALESORDER


will return different results than:

afAction=GET_SALESORDER, PUT_SALESORDER


Search Event Action By RegEx

…is also available (like a typical MongoDB Query). For example, to return all Event Actions that have PRODUCT in the string, use the filter:

afAction=/PRODUCT/


This returns Event documents for REFRESH_PRODUCT, GET_PRODUCT, PUT_PRODUCT.


This example:

afAction=/PRODUCT/


returns all Event Actions that have SALES in the string, such as GET_SALESORDER, PUT_SALESORDER, REFRESH_SALESORDER.


Search by Event Date/Time

To return all events on or after 10/21/18 (UTC) :

eventDateTimeUTC>2018-10-21


Can use multiple lines to create a range to search like :

eventDateTimeUTC>2018-10-21T17:00
eventDateTimeUTC<2018-10-21T18:00


Search By Event ID

Search for a specific Event ID:

eventID=f2f9d307-86b1-4d55-b9cf-dffb2aeb807d


Search by Session ID

Search for a specific Session ID:

afSessionID=9d292bbd-7fba-4e79-9b78-1c6163604855


Search Session ID by RegEx

To return all Event documents where the Session IDs begins with a 9

afSessionID=/^9/


Search By Event Source (Service)

To return all Event Source (eventSource) equal to GATEWAY-SERVICE OR TRANSLATION-SERVICE, the filter text would be like:

eventSource=GATEWAY-SERVICE,TRANSLATION-SERVICE


Search Event Source By RegEx

To return all Event documents with eventSource containing ‘GATEWAY’:

eventSource=/GATEWAY/


Search By Session State

To return all Session States (afState) equal to RETRY OR ERROR, the filter text would be like:

afState=RETRY,ERROR


Search Session State By RegEx

For example:

afState=/IN/


returns all Session State with ‘IN’ - INIT, INPROGRESS


Search By Primary File/Full Text Search

Can search for any document that contains an order number ‘#1025’ - Shopify could have this value on a GET_SALESORDER as the ’order.name’ or ‘order.customer.last_order_name’, etc. - or, if it’s an important field (like a reference field), it could return documents for GET_SALESORDER, DO_TRANSLATION, PUT_SALESORDER, END_AUTOMATION_FLOW to follow the entire document flow, or return a FULFILLMENT document with the order number referenced.

#1025



Can search for an email like 'johndoe123@gmail.com` by adding the filter criteria :

johndoe


Search using dot notation like :

primaryFile.inlineData.product.published_scope=global


Search By Business Reference

To search by businessReference, use the dot notation with primaryFile. Using commas, you can create an OR query with multiple values, but spaces are not trimmed since it is a full text search.


For example, you cannot have spaces around values when searching in primaryFile, since:

primaryFile.businessReference=#1022,#1025,#1023


will return different results than:

primaryFile.businessReference=#1022,#1025, #1023


Remember that when searching by business reference, you have to be aware of what field is configured to hold the business reference. Use the above example to understand the syntax of the query, but the specific values you put after the "=" will depend on which system the documents are coming from and what field is configured as your business reference.


Search By Remote ID

Currently can’t search with a string of numbers, must use the regex version of the search [SAFE-1641]

primaryFile.remoteID=738322055286


Search Remote ID By RegEx

This filter will return results :

primaryFile.remoteID=/738322055286/


URL Encoding Syntax

The following describes how common search characters are represented in the URL string.


Code Mirror Text
Encoding
Description
space
%20
space
=
%3D
equal sign
,
%2C
comma
\n
&
each line in code mirror is added to query with AND
/
%2F
regex slash



Combining Search Criteria

You can combine search criteria as well, by putting each criteria on a new line. These will create AND queries to narrow the search results. For example:

eventDateTimeUTC<2018-11-09T19:00
eventDateTimeUTC>2018-11-09T18:00
afStatusCode=429
afAction=/PRODUCT/


This query searches "within a specific one hour time block", all product transactions, that have received a 429 response.


Weird Behavior/Possible Bugs

  • Cannot navigate via keyboard from code mirror text area to the ‘Submit Filter’ button (Accessibility)
  • [SAFE-1600] When refreshing the page, the first request is the API request without &fields=..., the second request contains the fields. Appears to be making multiple calls, ex:    
    1. Request URL: https://qa.apps.nchannel.com/visibility/10173/events?page=1&pageSize=20&afStatusCode%3D%20204%2C200&&
    2. Request URL: https://qa.apps.nchannel.com/visibility/v1/10173/events?page=1&pageSize=20&afStatusCode%3D%20204%2C200&&&fields=afSessionID,afAction,afStatusCode,afState,eventID,eventDateTimeUTC,eventSource,parentEventIDs