Formatters
provide.foundation.integrations.openobserve.formatters
¶
TODO: Add module docstring.
Classes¶
Functions¶
format_csv
¶
Format response as CSV.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
SearchResponse
|
Search response |
required |
columns
|
list[str] | None
|
Specific columns to include (None for all) |
None
|
Returns:
| Type | Description |
|---|---|
str
|
CSV string |
Source code in provide/foundation/integrations/openobserve/formatters.py
format_json
¶
Format response as JSON.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
SearchResponse | dict[str, Any]
|
Search response or log entry |
required |
pretty
|
bool
|
If True, use pretty printing |
True
|
Returns:
| Type | Description |
|---|---|
str
|
JSON string |
Source code in provide/foundation/integrations/openobserve/formatters.py
format_log_line
¶
Format a log entry as a traditional log line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
dict[str, Any]
|
Log entry dictionary |
required |
Returns:
| Type | Description |
|---|---|
str
|
Formatted log line |
Source code in provide/foundation/integrations/openobserve/formatters.py
format_output
¶
format_output(
response: SearchResponse | dict[str, Any],
format_type: str = "log",
**kwargs: Any
) -> str
Format output based on specified type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
SearchResponse | dict[str, Any]
|
Search response or log entry |
required |
format_type
|
str
|
Output format (json, log, table, csv, summary) |
'log'
|
**kwargs
|
Any
|
Additional format-specific options |
{}
|
Returns:
| Type | Description |
|---|---|
str
|
Formatted string |
Source code in provide/foundation/integrations/openobserve/formatters.py
format_summary
¶
Format a summary of the search response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
SearchResponse
|
Search response |
required |
Returns:
| Type | Description |
|---|---|
str
|
Summary string |
Source code in provide/foundation/integrations/openobserve/formatters.py
format_table
¶
Format response as a table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
SearchResponse
|
Search response |
required |
columns
|
list[str] | None
|
Specific columns to include (None for all) |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Table string |