---
title: "Gets estimated usage details per view."
method: POST
path: "/v1/logSearches/estimatedUsageByView"
tags: ["logSearchesEstimatedUsage"]
---

# Gets estimated usage details per view.

`POST /v1/logSearches/estimatedUsageByView`

Gets the estimated volume of data, per view,  that would be scanned for running a given log search for a given timerange.

## Request body

- LogSearchEstimatedUsageRequestV3 — Base definition of the log search with query and timerange (without runByReceiptTime).
  - `queryString` string, required — Log search Query to compute the estimated volume of data scanned.
  - `timeRange` ResolvableTimeRange, required
    - `type` string, required — Type of the time range. Value must be either `CompleteLiteralTimeRange` or `BeginBoundedTimeRange`.
  - `queryParameters` LogSearchQueryParameterSyncDefinitionBase[] — Values for search template used in the search query. Learn more about the search templates here : https://help.sumologic.com/docs/search/get-started-with-search/build-search/search-templates/
    - `autoComplete` AutoCompleteDefinition
      - `type` string, required — The autocomplete parameter type.
      - `autoCompleteKey` string — The autocomplete key to be used to fetch autocomplete values.
      - `autoCompleteValues` AutoCompleteValueSyncDefinition[] — The array of label-value pairs for autocomplete.
        - `label` string, required — The label of the autocomplete value.
        - `value` string, required — The value of the autocomplete value.
      - `lookupMetaData` AutoCompleteLookupMetaData
        - `fileName` string — The lookup file name to use as a source for autocomplete values.
        - `valueColumn` string — The column from the lookup file to use as the value.
        - `labelColumn` string — The column from the lookup file to use as the label.
    - `name` string, required — The name of the parameter.
    - `description` string — A description of the parameter.
    - `dataType` string, required — The data type of the parameter. Supported values are: 1. `NUMBER` 2. `STRING` 3. `ANY` 4. `KEYWORD`
    - `value` string, required — A value for the parameter. Should be compatible with the type set in dataType field.
  - `intervalTimeType` string — This parameter defines whether you want to run the search by messageTime, receiptTime, or searchableTime. By default, the search will run by messageTime. If both runByReceiptTime and intervalTimeType parameters are present then the preference will be given to the intervalTimeType.
  - `runByReceiptTime` boolean — This has the value `true` if the search is to be run by receipt time and `false` if it is to be run by message time.
  - `timezone` string, required — Time zone to get the estimated usage details. Follow the format in the [IANA Time Zone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
  - `emulateSearchContext` EmulateSearchContext — Contains keys like "roleIds" with a list of role IDs or "userId" as a string.
    - `roleIds` string[] — List of role IDs to emulate the search context for.
    - `userId` string — User ID to emulate the search context for.

## Response `200`

Log search information along with its view wise estimated usage details.

- LogSearchEstimatedUsageByViewDefinition — Base definition of the log search with query and timerange (without runByReceiptTime).
  - `queryString` string, required — Log search Query to compute the estimated volume of data scanned.
  - `timeRange` ResolvableTimeRange, required
    - `type` string, required — Type of the time range. Value must be either `CompleteLiteralTimeRange` or `BeginBoundedTimeRange`.
  - `queryParameters` LogSearchQueryParameterSyncDefinitionBase[] — Values for search template used in the search query. Learn more about the search templates here : https://help.sumologic.com/docs/search/get-started-with-search/build-search/search-templates/
    - `autoComplete` AutoCompleteDefinition
      - `type` string, required — The autocomplete parameter type.
      - `autoCompleteKey` string — The autocomplete key to be used to fetch autocomplete values.
      - `autoCompleteValues` AutoCompleteValueSyncDefinition[] — The array of label-value pairs for autocomplete.
        - `label` string, required — The label of the autocomplete value.
        - `value` string, required — The value of the autocomplete value.
      - `lookupMetaData` AutoCompleteLookupMetaData
        - `fileName` string — The lookup file name to use as a source for autocomplete values.
        - `valueColumn` string — The column from the lookup file to use as the value.
        - `labelColumn` string — The column from the lookup file to use as the label.
    - `name` string, required — The name of the parameter.
    - `description` string — A description of the parameter.
    - `dataType` string, required — The data type of the parameter. Supported values are: 1. `NUMBER` 2. `STRING` 3. `ANY` 4. `KEYWORD`
    - `value` string, required — A value for the parameter. Should be compatible with the type set in dataType field.
  - `intervalTimeType` string — This parameter defines whether you want to run the search by messageTime, receiptTime, or searchableTime. By default, the search will run by messageTime. If both runByReceiptTime and intervalTimeType parameters are present then the preference will be given to the intervalTimeType.
  - `runByReceiptTime` boolean — This has the value `true` if the search is to be run by receipt time and `false` if it is to be run by message time.
  - `timezone` string, required — Time zone to get the estimated usage details. Follow the format in the [IANA Time Zone Database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List).
  - `emulateSearchContext` EmulateSearchContext — Contains keys like "roleIds" with a list of role IDs or "userId" as a string.
    - `roleIds` string[] — List of role IDs to emulate the search context for.
    - `userId` string — User ID to emulate the search context for.
  - `estimatedUsageDetails` EstimatedUsageDetailsPerView[], required
    - `viewName` string, required — Name of the view for which usage is estimated.
    - `usageDetails` EstimatedUsageDetailsWithMeteringType[], required — The scanning and data retrieval usages to run the query per view.
      - `meteringType` string — Name of the metering type. Metering type indicates how the data scanned within a particular data tier is actually metered and billed. Supported Values are Continuous, Frequent, Infrequent, ContinuousSecurity and FlexSecurity.
      - `dataScannedInBytes` integer — Amount of data scanned in bytes, to run the query.
      - `tier` string — Name of the data tier. Supported Values are Continuous, Frequent, Infrequent and Flex.
      - `scanCreditAccounted` boolean — Whether particular metering type is accounted against a customer's credit on a per scan basis. e.g Data belonging to "Flex" and "Infrequent" metering type is accounted for credits on per scan basis. For other metering types, eg. "Continuous" it's charged upfront during ingestion.

## Other responses

- `default` — Operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/versions/18a824df1e78/schema)
