Skip to content

Commit 638a0ad

Browse files
authored
Update http_events table schema in API quickstart. (#181)
* Update http_events table schema in API quickstart. Signed-off-by: Hannah Troisi <htroisi@pixielabs.ai> * add other columns Signed-off-by: Hannah Troisi <htroisi@pixielabs.ai> * tweak Signed-off-by: Hannah Troisi <htroisi@pixielabs.ai> * tweak Signed-off-by: Hannah Troisi <htroisi@pixielabs.ai>
1 parent eba3b30 commit 638a0ad

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

content/en/03-using-pixie/03-api-quick-start.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ if err != nil {
8787
# Define a PxL query with one output table.
8888
PXL_SCRIPT = """
8989
import px
90-
df = px.DataFrame('http_events')[['http_resp_status','http_req_path']]
90+
df = px.DataFrame('http_events')[['resp_status','req_path']]
9191
df = df.head(10)
9292
px.display(df, 'http_table')
9393
"""
@@ -97,15 +97,15 @@ script = conn.prepare_script(PXL_SCRIPT)
9797

9898
# Print the table output.
9999
for row in script.results("http_table"):
100-
print(row["http_resp_status"], row["http_req_path"])
100+
print(row["resp_status"], row["req_path"])
101101
```
102102

103103
```go
104104
// Define a PxL script with out output table.
105105
pxl := `
106106
import px
107107
df = px.DataFrame('http_events')
108-
df = df[['upid', 'http_req_path', 'remote_addr', 'http_req_method']]
108+
df = df[['upid', 'req_path', 'remote_addr', 'req_method']]
109109
df = df.head(10)
110110
px.display(df, 'http')
111111
`
@@ -172,7 +172,7 @@ import pxapi
172172
# Define a PxL query with one output table.
173173
PXL_SCRIPT = """
174174
import px
175-
df = px.DataFrame('http_events')[['http_resp_status','http_req_path']]
175+
df = px.DataFrame('http_events')[['resp_status','req_path']]
176176
df = df.head(10)
177177
px.display(df, 'http_table')
178178
"""
@@ -188,7 +188,7 @@ script = conn.prepare_script(PXL_SCRIPT)
188188

189189
# Print the table output.
190190
for row in script.results("http_table"):
191-
print(row["http_resp_status"], row["http_req_path"])
191+
print(row["resp_status"], row["req_path"])
192192
```
193193

194194
```go
@@ -210,7 +210,7 @@ var (
210210
pxl = `
211211
import px
212212
df = px.DataFrame('http_events')
213-
df = df[['upid', 'http_req_path', 'remote_addr', 'http_req_method']]
213+
df = df[['upid', 'req_path', 'remote_addr', 'req_method']]
214214
df = df.head(10)
215215
px.display(df, 'http')
216216
`

0 commit comments

Comments
 (0)