Skip to content

Commit 08c5d09

Browse files
committed
Update
Signed-off-by: Peng Huo <[email protected]>
1 parent 80103f6 commit 08c5d09

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/user/ppl/reference/splunk_to_ppl_cheat_sheet.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This cheat sheet helps Splunk users transition to OpenSearch's PPL. It maps comm
88
|--------|------------|---------------|-------|
99
| Query structure | `search terms \| command` | `source = index \| command` | PPL requires explicit source at the beginning |
1010
| Index reference | `index=name*` | `source=name*` | Different command to specify data source, [PPL support refering to multiple indices](https://github.com/opensearch-project/sql/blob/main/docs/user/ppl/general/identifiers.rst#multiple-indices)|
11+
| Raw field | Special `_raw` field | Identify a field in your OpenSearch data that contains the text content you want to work with (often `message` or `content` fields in log data) | No default raw field |
1112
| Time field | Special `_time` field | User-specified timestamp field | No default time field in PPL, must reference it explicitly |
1213

1314

@@ -155,9 +156,16 @@ This table provides a mapping between Splunk SPL commands and their OpenSearch P
155156
| Include fields | `... \| fields field1, field2` | `... \| fields field1, field2` | Same syntax |
156157
| Exclude fields | `... \| fields - field3` | `... \| fields - field3` | Same syntax |
157158
| Rename fields | `... \| rename field1 AS new_name` | `... \| rename field1 as new_name` | PPL uses lowercase "as" |
158-
| Replace null values | `... \| fillnull value=0 field1, field2` | `... \| fillnull value=0 field1, field2` | Same syntax |
159+
| Replace null values | `... \| fillnull value=0 field1, field2` | `... \| fillnull with 0 in field1, field2` | Similar syntax but different format |
159160
| Expand multi-value | `... \| mvexpand field1` | `... \| expand field1` | Different command name |
160161

162+
## Handling Null Values
163+
164+
| Operation | Splunk SPL | OpenSearch PPL | Notes |
165+
|-----------|------------|---------------|-------|
166+
| Basic null replacement | `... \| fillnull value=0 field1` | `... \| fillnull with 0 in field1` | Similar syntax but uses `with...in` format |
167+
| Multiple fields | `... \| fillnull value="N/A" field1, field2, field3` | `... \| fillnull with 'N/A' in field1, field2, field3` | Similar syntax but uses `with...in` format |
168+
161169
## Results Limiting
162170

163171
| Operation | Splunk SPL | OpenSearch PPL | Notes |

0 commit comments

Comments
 (0)