Rudedog9d / query-bar

Gitlab style query bar
MIT License
0 stars 0 forks source link

Different Query Languages #2

Open Rudedog9d opened 5 years ago

Rudedog9d commented 5 years ago

After some offline brainstorming with @Sidneys1, we came up with a couple syntax's for complex querying.

image

Find 200 in the status field

status:200

Find all status codes between 400-499

status:[400 TO 499]

Find status codes 400-499 with the extension php

status:[400 TO 499] AND extension:PHP

Find status codes 400-499 with the extension php or html

status:[400 TO 499] AND (extension:php OR extension:html)


- Pythonic: Query will look _similiar_ to python code, but with a couple adjustments for simplicity
  - Instead of `range(400, 500)` , support expanding lists with an ellipse: `[400..500]`
```py
# Find requests that contain the number 200, in any field
200

# Find 200 in the status field
status is 200

# Find all status codes between 400-499
status in [400..499]

# Find status codes 400-499 with the extension php
status in [400..499] and extension is "PHP"

# Find status codes 400-499 with the extension php or html
status in [400..499] and extension in ["php", "html"]
Sidneys1 commented 5 years ago

And then there's powershell…

($status -in 400..499) -and ($extension -in @("php", "html"))