Skip to content

Instantly share code, notes, and snippets.

@hexfusion
Created March 30, 2020 11:12
Show Gist options
  • Select an option

  • Save hexfusion/6bf38b14c8f1a6362050f299bf3f7e03 to your computer and use it in GitHub Desktop.

Select an option

Save hexfusion/6bf38b14c8f1a6362050f299bf3f7e03 to your computer and use it in GitHub Desktop.
elastic
HEAD /index
GET /index/_source
@hexfusion

Copy link
Copy Markdown
Author
  POST /test-index/events
 {
  "items":{
    "properties":{
      "firstTimestamp":{ "type" : "date" },
      "count":{ "type" : "int" },
      "involvedObject":{
        "properties":{
          "kind":{"type" : "text"},
          "name":{"type" : "text"},
          "uuid":{"type" : "text"}
        }
      },
      "kind":{"type" : "text" },
      "lastTimestamp":{"type" : "date" },
      "message":{ "type" :"text" },
      "metadata":{
        "properties":{
          "creationTimestamp":{"type": "date"},
          "name":{"type": "text"},
          "namespace":{"type": "text"},
          "resourceVersion":{"type": "text"},
          "selfLink":{"type": "text"},
          "uuid":{"type": "text"}
        }
      },
      "reason":{ "type":"text" },
      "reportingComponent":{ "type":"text" },
      "reportingInstance" :{ "type":"text" },
      "source":{
        "properties":{
          "component":{"type": "text"},
          "host":{"type": "text"}
        }
      }
    }
  }
}

@hexfusion

hexfusion commented Mar 30, 2020 •

Copy link
Copy Markdown
Author
PUT v2
{
  "mappings": {
    "properties": {
      "items": {
        "type": "nested",
        "properties": {
          "firstTimestamp": {
            "type": "date"
          },
          "count": {
            "type": "integer"
          },
          "kind": {
            "type": "text"
          },
          "lastTimestamp": {
            "type": "date"
          },
          "message": {
            "type": "text"
          },
          "reason": {
            "type": "text"
          },
          "reportingComponent": {
            "type": "text"
          },
          "reportingInstance": {
            "type": "text"
          },
          "source": {
            "properties": {
              "component": {
                "type": "text"
              },
              "host": {
                "type": "text"
              }
            }
          },
          "involvedObject": {
            "properties": {
              "kind": {
                "type": "text"
              },
              "name": {
                "type": "text"
              },
              "uuid": {
                "type": "text"
              }
            }
          },
          "metadata": {
            "properties": {
              "creationTimestamp": {
                "type": "date"
              },
              "name": {
                "type": "text"
              },
              "namespace": {
                "type": "text"
              },
              "resourceVersion": {
                "type": "text"
              },
              "selfLink": {
                "type": "text"
              },
              "uuid": {
                "type": "text"
              }
            }
          }
        }
      }
    }
  }
}

@hexfusion

Copy link
Copy Markdown
Author
PUT /events
{
  "mappings": {
    "properties": {
      "apiVersion": {
        "type": "text"
      },
      "firstTimestamp": {
        "type": "date"
      },
      "count": {
        "type": "integer"
      },
      "kind": {
        "type": "text"
      },
      "lastTimestamp": {
        "type": "date"
      },
      "message": {
        "type": "text"
      },
      "reason": {
        "type": "text"
      },
      "reportingComponent": {
        "type": "text"
      },
      "reportingInstance": {
        "type": "text"
      },
      "source": {
        "properties": {
          "component": {
            "type": "text"
          },
          "host": {
            "type": "text"
          }
        }
      },
      "involvedObject": {
        "properties": {
          "kind": {
            "type": "text"
          },
          "name": {
            "type": "text"
          },
          "uuid": {
            "type": "text"
          }
        }
      },
      "metadata": {
        "properties": {
          "creationTimestamp": {
            "type": "date"
          },
          "name": {
            "type": "text"
          },
          "namespace": {
            "type": "text"
          },
          "resourceVersion": {
            "type": "text"
          },
          "selfLink": {
            "type": "text"
          },
          "uuid": {
            "type": "text"
          }
        }
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment