Log

Object schema

The log object inherits it’s properties from the web3 API:

  • logIndex: Number - integer of the log index position in the block.
  • transactionIndex: Number - integer of the transactions index position log was created from.
  • transactionHash: String- hash of the transactions this log was created from.
  • blockHash: String - hash of the block where this log was in. null when its pending.
  • blockNumber: Number - the block number where this log was in. null when its pending.
  • address: String - address from which this log originated.
  • data: String - contains one or more non-indexed arguments of the log.
  • topics: Array of hex strings - Array of indexed log arguments.

Mapping

For some fields, there are multiple encodings available, which are nested as properties on the field. More information on those data types can be found here.

Note: For example the address is stored using the format raw (text stored as keyword) described on the datatypes page. In that particular case, the checksum-case formatted address can be used as a term filter query using address.raw and for a case-insensitive query, use address.

The following is the output of the Elasticsearch mapping for the Log type:

{
  "address": {
    "type": "text",
    "fields": {
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "blockHash": {
    "type": "keyword",
    "ignore_above": 256
  },
  "id": {
    "type": "keyword",
    "ignore_above": 256
  },
  "blockNumber": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "data": {
    "type": "keyword",
    "ignore_above": 256
  },
  "logIndex": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  },
  "type": {
    "type": "keyword",
    "ignore_above": 256
  },
  "timestamp": {
    "type": "date",
    "format": "epoch_second"
  },
  "topics": {
    "type": "keyword",
    "ignore_above": 256
  },
  "transactionHash": {
    "type": "keyword",
    "ignore_above": 256
  },
  "transactionIndex": {
    "properties": {
      "num": {
        "type": "long"
      },
      "raw": {
        "type": "keyword",
        "ignore_above": 256
      }
    }
  }
}