Date Parser
Overview
Date Parser is a filter that parses and converts character strings representing dates into another format, usually a date object that can be used in programming languages.
Configure Date Parser
To configure the Date Parser, follow the instructions below:
In the Processor information section , enter general information for a processor according to the instructions in Processor . In this content, you will choose Processor type as Date Parser .
In the Parsing rule section , enter the following information:
Enter Source field : field containing logs that will need to be parsed.
Enter Locate: the language used for the date format you desire. Locale affects the display and arrangement of day, date, month, and separators, for example year-month-day, day-month-year, or month-day-south.
Enter Timezone: time zone of a geographical region. Timezone affects the value of dates, because the same time can have different date values depending on the time zone. If you do not select Locale and Timezone , we will default to the system's Locale and Timezone.
Enter the Target field : the field will be overwritten in the destination log project, normally you will not need to enter this information
Enter Pattern: contains date pattern to match with source field and parse out according to structure.
For example:
Items | Value | Meaning | Source logs | Destination logs |
---|---|---|---|---|
Source field | date | Field nguồn cần parser là date. | { "date":"Apr 17 09:32:01 } | {"date":"2023-08-01T07:45:11.130Z",} |
Locate | Vietnamese | Ngôn ngữ sử dụng là Vietnamese. | nt | nt |
Timezone | N/A | Múi giờ lấy theo hệ thống. | nt | nt |
Target field | date_parser | Field được parser sẽ ghi đè vô Destination log ở field date_parser. | nt | nt |
Pattern | yyyy-MM-dd'T'HH:mm:ss.SSSZ | Định dạng ngày tháng của field date. | nt | nt |
![](https://docs.vngcloud.vn/~gitbook/image?url=https%3A%2F%2F1985221522-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F7rE7M1L7GYcwQzNGd0aB%252Fuploads%252FgnSzsjPLKMfEg8xfJRr8%252Fimage.png%3Falt%3Dmedia%26token%3D098b71a0-d6fa-4d20-9b6b-8e4883f23db1&width=768&dpr=4&quality=100&sign=3a8a0e4b&sv=1)
Store and reuse Parsing rules
You can store a parsing rule by checking Save this rule , then entering a memorable name for the parsing rule you want to store. The mnemonic name has a minimum length of 5 characters, a maximum length of 255 characters and can only include upper and lower case letters (az, AZ), numbers (0-9), and dots (.), space ( ), underscore (_), hyphen (-), and the @ character.
After the parsing rule has been stored, in subsequent processor creations you can reuse this rule by selecting Rule presets in the Pasing rule section.
Last updated