feat(webui): Add support for compressing unstructured text logs using CLP-JSON.#1861
Conversation
WalkthroughAdds a "Convert to JSON" (unstructured) checkbox to the compression UI, updates form types and submission payload to include Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Browser as Browser (UI)
participant API as Server API
participant Worker as Compression Worker
User->>Browser: Check "Convert to JSON" and submit form
Browser->>API: POST /api/compress { ..., unstructured: true }
API->>API: validate body against CompressionJobCreationSchema
API->>Worker: enqueue/create job with jobConfig.input.unstructured = true
Worker->>Worker: run compression job (perform unstructured -> JSON conversion)
Worker-->>API: job status/result
API-->>Browser: respond with job creation result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
# Conflicts: # components/webui/server/src/plugins/app/CompressionJobDbManager/typings.ts
hoophalab
left a comment
There was a problem hiding this comment.
LGTM. Not sure if it makes sense to disable the timestamp input box when "convert to json" is clicked.
Validation:
Unstructured logs are correctly compressed using WebUI.
Certainly. Making the changes now |
…s enabled and adjust tooltip logic
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@components/webui/client/src/pages/IngestPage/Compress/ClpSFormItems.tsx`:
- Around line 32-62: The JSX helper UNSTRUCTURED_HELPER_TEXT is using a
defensive fallback (styles["tooltipCode"] || "") for the Typography.Text
className; remove the redundant "|| ''" so the className is just
styles.tooltipCode (or styles["tooltipCode"]) and let React handle
undefined—update both occurrences inside UNSTRUCTURED_HELPER_TEXT (the
Typography.Text nodes) to remove the fallback and avoid forcing an empty string.
| const UNSTRUCTURED_HELPER_TEXT = ( | ||
| <> | ||
| Enable this for non-JSON logs. Each log event will be parsed and converted to JSON with | ||
| {" "} | ||
| <Typography.Text | ||
| className={styles["tooltipCode"] || ""} | ||
| code={true} | ||
| > | ||
| timestamp | ||
| </Typography.Text> | ||
| {" and "} | ||
| <Typography.Text | ||
| className={styles["tooltipCode"] || ""} | ||
| code={true} | ||
| > | ||
| message | ||
| </Typography.Text> | ||
| {" "} | ||
| fields. See the | ||
| {" "} | ||
| <Typography.Link | ||
| href={"https://docs.yscope.com/clp/main/user-docs/quick-start/clp-json.html#compressing-unstructured-text-logs"} | ||
| rel={"noopener"} | ||
| target={"_blank"} | ||
| > | ||
| documentation | ||
| </Typography.Link> | ||
| {" "} | ||
| for more details. | ||
| </> | ||
| ); |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider simplifying the className fallback.
The || "" fallback on lines 37 and 44 is defensive but may be unnecessary if the CSS module is properly configured. If the class doesn't exist, styles["tooltipCode"] would return undefined, which React handles gracefully by not applying any class.
Optional simplification
<Typography.Text
- className={styles["tooltipCode"] || ""}
+ className={styles["tooltipCode"]}
code={true}
>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const UNSTRUCTURED_HELPER_TEXT = ( | |
| <> | |
| Enable this for non-JSON logs. Each log event will be parsed and converted to JSON with | |
| {" "} | |
| <Typography.Text | |
| className={styles["tooltipCode"] || ""} | |
| code={true} | |
| > | |
| timestamp | |
| </Typography.Text> | |
| {" and "} | |
| <Typography.Text | |
| className={styles["tooltipCode"] || ""} | |
| code={true} | |
| > | |
| message | |
| </Typography.Text> | |
| {" "} | |
| fields. See the | |
| {" "} | |
| <Typography.Link | |
| href={"https://docs.yscope.com/clp/main/user-docs/quick-start/clp-json.html#compressing-unstructured-text-logs"} | |
| rel={"noopener"} | |
| target={"_blank"} | |
| > | |
| documentation | |
| </Typography.Link> | |
| {" "} | |
| for more details. | |
| </> | |
| ); | |
| const UNSTRUCTURED_HELPER_TEXT = ( | |
| <> | |
| Enable this for non-JSON logs. Each log event will be parsed and converted to JSON with | |
| {" "} | |
| <Typography.Text | |
| className={styles["tooltipCode"]} | |
| code={true} | |
| > | |
| timestamp | |
| </Typography.Text> | |
| {" and "} | |
| <Typography.Text | |
| className={styles["tooltipCode"]} | |
| code={true} | |
| > | |
| message | |
| </Typography.Text> | |
| {" "} | |
| fields. See the | |
| {" "} | |
| <Typography.Link | |
| href={"https://docs.yscope.com/clp/main/user-docs/quick-start/clp-json.html#compressing-unstructured-text-logs"} | |
| rel={"noopener"} | |
| target={"_blank"} | |
| > | |
| documentation | |
| </Typography.Link> | |
| {" "} | |
| for more details. | |
| </> | |
| ); |
🤖 Prompt for AI Agents
In `@components/webui/client/src/pages/IngestPage/Compress/ClpSFormItems.tsx`
around lines 32 - 62, The JSX helper UNSTRUCTURED_HELPER_TEXT is using a
defensive fallback (styles["tooltipCode"] || "") for the Typography.Text
className; remove the redundant "|| ''" so the className is just
styles.tooltipCode (or styles["tooltipCode"]) and let React handle
undefined—update both occurrences inside UNSTRUCTURED_HELPER_TEXT (the
Typography.Text nodes) to remove the fallback and avoid forcing an empty string.
Description
Add support for compressing unstructured text logs via the WebUI when using the CLP-JSON storage engine.
This feature adds an "Unstructured Logs" checkbox to the compression job form. When enabled, unstructured text logs are converted to JSON before compression, with each log event parsed into
timestampandmessagefields.Changes:
unstructuredboolean option to the compression job creation schema and APIunstructuredflag through to the compression job configChecklist
breaking change.
Validation performed
With the checkbox checked, compressed logs from the hive-24hr sample dataset. Errors are reported because the dataset contains empty files which can't be recognized as unstructured text logs files, which is unrelated to the PR.
Performed search in the webui with
message:*and observed results were returned.Summary by CodeRabbit
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.