Skip to content

Instantly share code, notes, and snippets.

@alexlarkou
Last active August 28, 2022 15:20
Show Gist options
  • Save alexlarkou/d7223b1dc2394e37cd04884390e59de6 to your computer and use it in GitHub Desktop.
Save alexlarkou/d7223b1dc2394e37cd04884390e59de6 to your computer and use it in GitHub Desktop.
Elasticsearch
from elasticsearch_dsl import Date, Document, Keyword, Nested, Text, Integer
class HttpLog(Document):
"""The schema for a Log document."""
level = Keyword()
request = Nested(properties={"body": Text(analyzer="snowball"), "headers": Keyword(), "arguments": Keyword()})
response = Nested(properties={"message": Text(analyzer="snowball"), "status": Integer()})
timestamp = Date()
stacktrace = Text()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment