Duansg opened a new pull request, #3645:
URL: https://github.com/apache/hertzbeat/pull/3645

   ## What's changed?
   
   Please refer to: [#3644](https://github.com/apache/hertzbeat/issues/3644)
   
   Added JEXL custom function that support nested JSON parsing.
   
   For details:
   1. Added JEXL custom json function
   2. Add test cases and pass historical test cases.
   
   ## Checklist
   
   - [x]  I have read the [Contributing 
Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
   - [x]  I have written the necessary doc or comment.
   - [x]  I have added the necessary unit tests and all cases have passed.
   
   ## Add or update API
   
   - [ ] I have added the necessary [e2e 
tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have 
passed.
   
   
   ```yaml
   metrics:
     - name: channel_item_info
         i18n:
           en-US: channel item info
         priority: 2
         fields:
           - field: type
             i18n:
               en-US: type
             type: 1
             label: true
           - field: current
             i18n:
               en-US: current
             type: 0
           - field: instanceCode
             i18n:
               en-US: instanceCode
             type: 1
           - field: timeMillis
             i18n:
               en-US: timeMillis
             type: 1
         aliasFields:
           - type
           - $.info
         calculates:
           - type=type
           - current=json:apply($.info).current
           - instanceCode=json:apply($.info).instanceCode
           - timeMillis=json:apply($.info).timeMillis
         protocol: http
         http:
           host: ^_^host^_^
           port: ^_^port^_^
           url: ^_^base_path^_^/item-center/channelItem
           method: GET
           ssl: ^_^ssl^_^
           authorization:
             type: Basic Auth
             basicAuthUsername: ^_^username^_^
             basicAuthPassword: ^_^password^_^
           parseType: jsonPath
           parseScript: '$'
   ```
   
   
   <img width="1504" height="455" alt="Snipaste_2025-08-08_01-25-00" 
src="https://github.com/user-attachments/assets/a91cbf1f-5a6b-4c98-be28-b5c6d0c99cff";
 />
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to