### Run Quickwit Instance Source: https://quickwit.io/docs/distributed-tracing/send-traces/using-otel-sdk-python Starts a Quickwit instance. Ensure Quickwit is installed before running. ```bash ./quickwit run ``` -------------------------------- ### Quickwit Indexing Log Example Source: https://quickwit.io/docs/log-management/send-logs/using-otel-collector-with-helm Example log output from Quickwit indicating that indexing has started. This output confirms the successful ingestion and processing of logs by the Quickwit indexer. ```log 2022-11-30T18:27:37.628Z INFO spawn_merge_pipeline{index=otel-log-v0 gen=0}: quickwit_indexing::actors::merge_pipeline: Spawning merge pipeline. index_id=otel-log-v0 source_id=_ingest-api-source pipeline_ord=0 root_dir=/quickwit/qwdata/indexing/otel-log-v0/_ingest-api-source merge_policy=StableLogMergePolicy { config: StableLogMergePolicyConfig { min_level_num_docs: 100000, merge_factor: 10, max_merge_factor: 12, maturation_period: 172800s }, split_num_docs_target: 10000000 } 2022-11-30T18:27:37.628Z INFO quickwit_serve::grpc: Starting gRPC server. enabled_grpc_services={"otlp-log", "otlp-trace"} grpc_listen_addr=0.0.0.0:7281 2022-11-30T18:27:37.628Z INFO quickwit_serve::rest: Starting REST server. rest_listen_addr=0.0.0.0:7280 2022-11-30T18:27:37.628Z INFO quickwit_serve::rest: Searcher ready to accept requests at http://0.0.0.0:7280/ 2022-11-30T18:27:42.654Z INFO quickwit_indexing::actors::indexer: new-split split_id="01GK4WPTXK8GH3AGTRNBN9A8YG" partition_id=0 2022-11-30T18:27:52.643Z INFO quickwit_indexing::actors::indexer: send-to-index-serializer commit_trigger=Timeout split_ids=01GK4WPTXK8GH3AGTRNBN9A8YG num_docs=22 2022-11-30T18:27:52.652Z INFO index_batch{index_id=otel-log-v0 source_id=_ingest-api-source pipeline_ord=0}:packager: quickwit_indexing::actors::packager: start-packaging-splits split_ids=["01GK4WPTXK8GH3AGTRNBN9A8YG"] 2022-11-30T18:27:52.652Z INFO index_batch{index_id=otel-log-v0 source_id=_ingest-api-source pipeline_ord=0}:packager: quickwit_indexing::actors::packager: create-packaged-split split_id="01GK4WPTXK8GH3AGTRNBN9A8YG" 2022-11-30T18:27:52.653Z INFO index_batch{index_id=otel-log-v0 source_id=_ingest-api-source pipeline_ord=0}:uploader: quickwit_indexing::actors::uploader: start-stage-and-store-splits split_ids=["01GK4WPTXK8GH3AGTRNBN9A8YG"] 2022-11-30T18:27:52.733Z INFO index_batch{index_id=otel-log-v0 source_id=_ingest-api-source pipeline_ord=0}:uploader:stage_and_upload{split=01GK4WPTXK8GH3AGTRNBN9A8YG}:store_split: quickwit_indexing::split_store::indexing_split_store: store-split-remote-success split_size_in_megabytes=0.018351 num_docs=22 elapsed_secs=0.07654519 throughput_mb_s=0.23974074 is_mature=false ``` -------------------------------- ### Install Quickwit using Installer Script Source: https://quickwit.io/docs/get-started/quickstart Use this command to download and run the Quickwit installer script. It automatically detects your OS and architecture. ```bash curl -L https://install.quickwit.io | sh ``` -------------------------------- ### Install Quickwit using curl Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs Download and install the Quickwit binary using curl. Navigate into the extracted directory after installation. ```bash curl -L https://install.quickwit.io | sh cd quickwit-v*/ ``` -------------------------------- ### Install Quickwit Helm Chart Source: https://quickwit.io/docs/log-management/send-logs/using-otel-collector-with-helm Installs the Quickwit Helm chart using the previously created `qw-tutorial-values.yaml` configuration file. ```bash helm install quickwit quickwit/quickwit -f qw-tutorial-values.yaml ``` -------------------------------- ### Minimal Quickwit Configuration with File-Backed Metastore Source: https://quickwit.io/docs/deployment/kubernetes/helm An example `values.yaml` file for a minimal Quickwit installation using a file-backed metastore. This configuration is primarily for testing purposes. ```yaml environment: QW_METASTORE_URI: s3:///quickwit-indexes config: default_index_root_uri: s3:///quickwit-indexes storage: s3: region: eu-east-1 # We recommend using IAM roles and permissions to access Amazon S3 resources, # but you can specify a pair of access and secret keys if necessary. access_key_id: secret_access_key: ``` -------------------------------- ### Pulsar Indexing Pipeline Log Example Source: https://quickwit.io/docs/ingest-data/pulsar Example log output indicating that Quickwit has started an indexing pipeline for the Pulsar source. ```text INFO spawn_pipeline{index=stackoverflow gen=0}:pulsar-consumer{subscription_name="quickwit-stackoverflow-pulsar-source" params=PulsarSourceParams { topics: ["stackoverflow"], address: "pulsar://localhost:6650", consumer_name: "quickwit", authentication: None } current_positions={}}: quickwit_indexing::source::pulsar_source: Seeking to last checkpoint positions. positions={} ``` -------------------------------- ### Start Quickwit with OTLP Exporter Source: https://quickwit.io/docs/distributed-tracing/plug-quickwit-to-jaeger Start a Quickwit instance with the OpenTelemetry OTLP exporter enabled and configured to send traces to a specified endpoint. This setup allows Quickwit to ingest its own traces. ```bash QW_ENABLE_OPENTELEMETRY_OTLP_EXPORTER=true \ OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:7281 \ ./quickwit run ``` -------------------------------- ### Start Quickwit Server (CLI) Source: https://quickwit.io/docs/get-started/quickstart Run this command to start the Quickwit server using the command-line interface. ```bash ./quickwit run ``` -------------------------------- ### Start Fluentbit Service Source: https://quickwit.io/docs/log-management/send-logs/using-fluentbit Starts the Fluent Bit service using a specified configuration file. ```bash fluent-bit -c fluent-bit.conf ``` -------------------------------- ### Example Log Entry Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs This is an example of a log entry structure that Quickwit can process. ```json { "timestamp": 1460530013, "severity_text": "INFO", "body": "PacketResponder: BP-108841162-10.10.34.11-1440074360971:blk_1074072698_331874, type=HAS_DOWNSTREAM_IN_PIPELINE terminating", "resource": { "service": "datanode/01" }, "attributes": { "class": "org.apache.hadoop.hdfs.server.datanode.DataNode" }, "tenant_id": 58 } ``` -------------------------------- ### Partition Key DSL Examples Source: https://quickwit.io/docs/overview/concepts/querying Examples of Quickwit's DSL for routing documents into partitions based on field values and hash functions. ```text tenant_id ``` ```text tenant_id,app_id ``` ```text tenant_id,hash_mod(app_id, 8) ``` ```text hash_mod((tenant_id,app_id), 50) ``` -------------------------------- ### Start Quickwit Searcher and Metastore Services and Make a Search Request Source: https://quickwit.io/docs/reference/cli Starts the searcher and metastore services and then makes a search request to the Quickwit REST API. Ensure the index and data are set up first. ```bash # To create wikipedia index and ingest data, go to our tutorials https://quickwit.io/docs/get-started/. # Start a searcher. quickwit run --service searcher --service metastore --config=./config/quickwit.yaml # Make a request. curl "http://127.0.0.1:7280/api/v1/wikipedia/search?query=barack+obama" ``` -------------------------------- ### Start Quickwit Server (Docker) Source: https://quickwit.io/docs/get-started/quickstart Start the Quickwit server using Docker, mounting a local directory for data persistence and exposing the default port. ```bash docker run --rm -v $(pwd)/qwdata:/quickwit/qwdata -p 127.0.0.1:7280:7280 quickwit/quickwit run ``` -------------------------------- ### Install build dependencies on Ubuntu Source: https://quickwit.io/docs/get-started/installation Installs necessary development dependencies for compiling Quickwit on Ubuntu systems. ```bash apt install -y clang protobuf-compiler libssl-dev pkg-config cmake ``` -------------------------------- ### Verify Quickwit Installation (Installer) Source: https://quickwit.io/docs/get-started/quickstart After installation, navigate to the extracted directory and run this command to check the Quickwit version. ```bash cd ./quickwit-v*/ ./quickwit --version ``` -------------------------------- ### Example Log Entry Structure Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs-distributed-search-aws-s3 This is an example of a log entry that can be indexed by Quickwit. It includes a timestamp, severity, body, and resource information. ```json { "timestamp": 1460530013, "severity_text": "INFO", "body": "PacketResponder: BP-108841162-10.10.34.11-1440074360971:blk_1074072698_331874, type=HAS_DOWNSTREAM_IN_PIPELINE terminating", "resource": { "service": "datanode/01" }, "attributes": { "class": "org.apache.hadoop.hdfs.server.datanode.DataNode" } } ``` -------------------------------- ### Example Environment Variable Definition Source: https://quickwit.io/docs/configuration/node-config Example of setting an environment variable that can be used in configuration files. ```bash export QW_LISTEN_ADDRESS=0.0.0.0 ``` -------------------------------- ### Install libssl on Ubuntu Source: https://quickwit.io/docs/get-started/installation Installs the libssl library on Ubuntu systems using apt-get. ```bash apt-get -y update && apt-get -y install libssl ``` -------------------------------- ### Install Quickwit using Glasskube CLI Source: https://quickwit.io/docs/deployment/kubernetes/glasskube Installs Quickwit into the 'quickwit' namespace using the Glasskube CLI. You will need to provide configuration values for defaultIndexRootUri, metastoreUri, s3Endpoint, s3Flavor, s3Region, s3AccessKeyId, and s3SecretAccessKey. ```bash glasskube install quickwit ``` -------------------------------- ### Create Source Configuration Example Source: https://quickwit.io/docs/reference/rest-api Example JSON payload for creating a Kafka source, specifying version, source ID, type, and connection parameters. ```json { "version": "0.7", "source_id": "kafka-source", "source_type": "kafka", "params": { "topic": "quickwit-fts-staging", "client_params": { "bootstrap.servers": "kafka-quickwit-server:9092" } } } ``` -------------------------------- ### Run Quickwit Server Source: https://quickwit.io/docs/distributed-tracing/send-traces/using-otel-collector Start a Quickwit server instance. This command is used for local testing and development. ```bash ./quickwit run ``` -------------------------------- ### Start Quickwit Indexer and Metastore Services Source: https://quickwit.io/docs/reference/cli Starts the indexer and metastore services for Quickwit. The --endpoint option specifies the Quickwit node URL. ```bash quickwit run --service indexer --service metastore --endpoint=http://127.0.0.1:7280 ``` -------------------------------- ### Quickwit Server Log Output Example Source: https://quickwit.io/docs/log-management/send-logs/using-otel-collector Example log message observed on the Quickwit server after successful ingestion from the OTEL Collector. ```log 2023-03-16T13:44:09.369Z INFO quickwit_indexing::actors::indexer: new-split split_id="01GVNAKT5TQW0T2QGA245XCMTJ" partition_id=6444214793425557444 ``` -------------------------------- ### Launch Quickwit Server Source: https://quickwit.io/docs/ingest-data/kinesis Command to start Quickwit in server mode, enabling indexing and search services. ```bash # Finally, execute this command to start Quickwit in server mode. ./quickwit server ``` -------------------------------- ### Dynamic Field Query Examples Source: https://quickwit.io/docs/configuration/index-config Examples demonstrating how to query fields in a dynamically mapped index, including nested objects and boolean combinations. ```text // Fields can be searched simply. endpoint:/admin // Nested object can be queried by specifying a `.` separated // path from the root of the json object to the given field. query_params.ctk:e42bb897d // numbers are searchable too src.port:53 // and of course we can combine them with boolean operators. src.port:53 AND query_params.ctk:e42bb897d ``` -------------------------------- ### Start Quickwit Control Plane, Metastore, and Janitor Services Source: https://quickwit.io/docs/reference/cli Starts the control plane, metastore, and janitor services. The --config option specifies the configuration file location. ```bash quickwit run --service control_plane --service metastore --service janitor --config=./config/quickwit.yaml ``` -------------------------------- ### Install build dependencies on Arch Linux Source: https://quickwit.io/docs/get-started/installation Installs necessary development dependencies for compiling Quickwit on Arch Linux systems. ```bash pacman -S clang protobuf openssl pkg-config cmake make ``` -------------------------------- ### Docker Commands to Start Services Source: https://quickwit.io/docs/log-management/send-logs/send-docker-logs Commands to create a directory for Quickwit data and start the Quickwit and OpenTelemetry Collector services using Docker Compose. ```bash mkdir qwdata docker compose up ``` -------------------------------- ### Example Document for Dynamic Indexing Source: https://quickwit.io/docs/configuration/index-config An example of a complex JSON document that can be indexed using Quickwit's dynamic mapping. ```json { "endpoint": "/admin", "query_params": { "ctk": "e42bb897d", "page": "eeb" }, "src": { "ip": "8.8.8.8", "port": 53, }, //... } ``` -------------------------------- ### Install glasskube CLI and kind Kubernetes Cluster Source: https://quickwit.io/docs/deployment/kubernetes/glasskube Installs the glasskube CLI using Homebrew and creates a local Kubernetes cluster with kind. Ensure you have kubectl and a compatible Kubernetes cluster. ```bash brew install glasskube/tap/glasskube # install the glasskube cli kind create cluster # create a kind Kubernetes cluster ``` -------------------------------- ### Example Log Structure in Quickwit UI Source: https://quickwit.io/docs/log-management/send-logs/send-docker-logs An example of a log entry as it might appear in the Quickwit UI after being processed by the OpenTelemetry Collector. It includes attributes, the log body, and timestamps. ```json { "attributes": { "log.file.name": "34ad1a84c71de1d29ad75f99b56d01205e2976440f2398734037151ba2bcde1a-json.log", "stream": "stdout" }, "body": { "message": "2023-10-23T16:39:57.892 INFO --- [ asgi_gw_1] localstack.request.aws : AWS s3.ListObjects => 200\n" }, "observed_timestamp_nanos": 1698079197979435000, "service_name": "unknown_service", "severity_number": 0, "timestamp_nanos": 1698079197892726000, "trace_flags": 0 } ``` -------------------------------- ### Term Prefix Query Example Source: https://quickwit.io/docs/reference/query-language Example of a term prefix query. Matches documents where the field starts with the specified prefix. ```plaintext field:prefix* ``` -------------------------------- ### Quickwit Setup and Workflow TLDR Source: https://quickwit.io/docs/get-started/quickstart A concise summary of commands to set up an index, ingest data, search, and delete the index. This is a quick reference for the entire workflow. ```bash curl -o stackoverflow-index-config.yaml https://raw.githubusercontent.com/quickwit-oss/quickwit/main/config/tutorials/stackoverflow/index-index-config.yaml ./quickwit index create --index-config ./stackoverflow-index-config.yaml curl -O https://quickwit-datasets-public.s3.amazonaws.com/stackoverflow.posts.transformed-10000.json ./quickwit index ingest --index stackoverflow --input-path ./stackoverflow.posts.transformed-10000.json --force ./quickwit index search --index stackoverflow --query "search AND engine" ./quickwit index delete --index stackoverflow ``` -------------------------------- ### Start Jaeger UI (Linux) Source: https://quickwit.io/docs/distributed-tracing/send-traces/using-otel-sdk-python Starts a Jaeger UI instance using Docker on Linux, configured to use Quickwit as its backend. This command uses the host network mode for easier integration. ```bash docker run --rm --name jaeger-qw --network=host \ -e SPAN_STORAGE_TYPE=grpc-plugin \ -e GRPC_STORAGE_SERVER=127.0.0.1:7281 \ -p 16686:16686 \ jaegertracing/jaeger-query:latest ``` -------------------------------- ### Phrase Prefix Query Example Source: https://quickwit.io/docs/reference/query-language Example of a phrase prefix query. Matches documents where the field contains a phrase starting with the given prefix. ```plaintext field:"finish this phr"* ``` -------------------------------- ### Create Quickwit Helm Chart Values File Source: https://quickwit.io/docs/log-management/send-logs/using-otel-collector-with-helm Generates a `qw-tutorial-values.yaml` file with basic configuration for Quickwit components, including S3 storage settings and enabling the OTEL endpoint. ```bash # Create Quickwit config file. echo " searcher: replicaCount: 1 indexer: replicaCount: 1 metastore: replicaCount: 1 janitor: enabled: true control_plane: enabled: true environment: # Remove ANSI colors. NO_COLOR: 1 # Quickwit configuration config: storage: s3: region: ${AWS_REGION} access_key_id: ${AWS_ACCESS_KEY_ID} secret_access_key: ${AWS_SECRET_ACCESS_KEY} # If you are not on AWS S3, you can define a flavor (gcs, minio, garage...) # and additional variables for your object storage. # flavor: gcs # endpoint: https://storage.googleapis.com # Metastore on S3. metastore_uri: ${DEFAULT_INDEX_ROOT_URI} default_index_root_uri: ${DEFAULT_INDEX_ROOT_URI} # Indexer settings indexer: # By activating the OTEL service, Quickwit will be able # to receive gRPC requests from OTEL collectors. enable_otlp_endpoint: true " > qw-tutorial-values.yaml ``` -------------------------------- ### Create Namespace for Quickwit Tutorial Source: https://quickwit.io/docs/deployment/kubernetes/gke Creates a Kubernetes namespace to host the Quickwit tutorial deployment. Ensure kubectl is configured to your GKE cluster. ```bash export NS=quickwit-tutorial kubectl create ns ${NS} ``` -------------------------------- ### Delete Task Payload Example Source: https://quickwit.io/docs/reference/rest-api This is an example of the JSON payload for creating a delete task. It includes the query to match documents, and optional start and end timestamps to restrict the deletion to a specific time range. ```json { "query": "body:trash", "start_timestamp": "1669738645", "end_timestamp": "1669825046", } ``` -------------------------------- ### Download and Create Quickwit Index Source: https://quickwit.io/docs/ingest-data/pulsar Download the index configuration file and create the 'stackoverflow' index in Quickwit. ```bash # Download stackoverflow index config. wget -O stackoverflow.yaml https://raw.githubusercontent.com/quickwit-oss/quickwit/main/config/tutorials/stackoverflow/index-config.yaml # Create index. ./quickwit index create --index-config stackoverflow.yaml ``` -------------------------------- ### Multi-target Search with Wildcard Indices Source: https://quickwit.io/docs/reference/es_compatible_api Use wildcard expressions in the index name to search across multiple indices that match a pattern. This example targets all indices starting with 'stackoverflow'. ```http GET api/v1/_elastic/stackoverflow*/_search { "query": { "query_string": { "query": "search AND engine", "fields": [ "title", "body" ] } } } ``` -------------------------------- ### Setup Python Environment for AWS CDK Source: https://quickwit.io/docs/get-started/tutorials/tutorial-aws-lambda-simple Install pipenv and necessary Python packages (boto3, aws-cdk-lib, click, pyyaml) for defining the AWS CloudFormation stack and invoking Lambdas. ```bash # Install pipenv if needed. pip install --user pipenv pipenv shell pipenv install ``` -------------------------------- ### Complete Index Configuration Example Source: https://quickwit.io/docs/configuration/index-config A comprehensive YAML configuration for a Quickwit index, demonstrating settings for version, index ID, storage URI, document mapping, search settings, and retention. ```yaml version: 0.7 # File format version. index_id: "hdfs" index_uri: "s3://my-bucket/hdfs" doc_mapping: mode: lenient field_mappings: - name: timestamp type: datetime input_formats: - unix_timestamp output_format: unix_timestamp_secs fast_precision: seconds fast: true - name: severity_text type: text tokenizer: raw fast: - tokenizer: lowercase - name: body type: text tokenizer: default record: position - name: resource type: object field_mappings: - name: service type: text tokenizer: raw tag_fields: ["resource.service"] timestamp_field: timestamp index_field_presence: true search_settings: default_search_fields: [severity_text, body] retention: period: 90 days schedule: daily ``` -------------------------------- ### Clone Quickwit Tutorials Repository Source: https://quickwit.io/docs/get-started/tutorials/tutorial-aws-lambda-simple Clone the Quickwit tutorials repository and navigate to the simple-lambda-stack directory. ```bash git clone https://github.com/quickwit-oss/tutorials.git cd tutorials/simple-lambda-stack ``` -------------------------------- ### Create Kubernetes Namespace and Set Context Source: https://quickwit.io/docs/log-management/send-logs/using-otel-collector-with-helm Creates a new namespace 'qw-tutorial' for isolating the Quickwit experiment and sets it as the current context. ```bash kubectl create namespace qw-tutorial kubectl config set-context --current --namespace=qw-tutorial ``` -------------------------------- ### Install OpenTelemetry Bootstrap Source: https://quickwit.io/docs/distributed-tracing/send-traces/using-otel-sdk-python Installs the opentelemetry-bootstrap tool, which is used for automatic instrumentation of Python applications. ```bash opentelemetry-bootstrap -a install ``` -------------------------------- ### Terms Aggregation Examples Source: https://quickwit.io/docs/reference/aggregation Examples demonstrating how to use the terms aggregation with different ordering options. ```APIDOC ## Terms Aggregation Examples ### Order alphabetically ```json { "query": "*", "max_hits": 0, "aggs": { "genres": { "terms": { "field": "genre", "order": { "_key": "asc" } } } } } ``` ### Order by sub_aggregation ```json { "query": "*", "max_hits": 0, "aggs": { "articles_by_price": { "terms": { "field": "article_name", "order": { "average_price": "asc" } }, "aggs": { "average_price": { "avg": { "field": "price" } } } } } } ``` ``` -------------------------------- ### Download and install Quickwit using script Source: https://quickwit.io/docs/get-started/installation Downloads and extracts the Quickwit binary archive for the current machine using a curl script. ```bash curl -L https://install.quickwit.io | sh ``` -------------------------------- ### Install Pulsar Python Client Source: https://quickwit.io/docs/ingest-data/pulsar Command to install the necessary Python client library for interacting with Pulsar. ```bash # Install pulsar python client. ``` -------------------------------- ### Configure and Run Second Quickwit Node Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs-distributed-search-aws-s3 Create a configuration file for the second Quickwit node, specifying its ID, metastore URI, and peer seeds. Then, start the Quickwit searcher service. ```yaml # configuration for our second node echo "version: 0.7 node_id: searcher-2 metastore_uri: ${S3_PATH} default_index_root_uri: ${S3_PATH} listen_address: 0.0.0.0 peer_seeds: - ${IP_NODE_1} # searcher-1 " > config.yaml # Start a Quickwit searcher. ./quickwit run --service searcher --config config.yaml ``` -------------------------------- ### Install openssl on Arch Linux Source: https://quickwit.io/docs/get-started/installation Installs the openssl package on Arch Linux systems using pacman. ```bash pacman -S openssl ``` -------------------------------- ### Serve Glasskube GUI Source: https://quickwit.io/docs/deployment/kubernetes/glasskube Starts the Glasskube GUI, making it accessible via a web browser. The GUI is typically available at http://localhost:8580. ```bash glasskube serve ``` -------------------------------- ### Install openssl on AWS Linux Source: https://quickwit.io/docs/get-started/installation Installs the openssl library on AWS Linux systems using yum. ```bash yum -y update && yum -y install openssl ``` -------------------------------- ### Download Source Config and Create Kafka Source Source: https://quickwit.io/docs/ingest-data/kafka Bash commands to download the Kafka source configuration file and then create the source within your Quickwit index. ```bash # Download Kafka source config. wget https://raw.githubusercontent.com/quickwit-oss/quickwit/main/config/tutorials/gh-archive/kafka-source.yaml # Create source. ./quickwit source create --index gh-archive --source-config kafka-source.yaml ``` -------------------------------- ### Boolean Field Mapping Example Source: https://quickwit.io/docs/configuration/index-config Example mapping for a boolean field, specifying its type and storage/indexing options. ```yaml name: is_active description: Activation status type: bool stored: true indexed: true fast: true ``` -------------------------------- ### Install Flask Dependency Source: https://quickwit.io/docs/distributed-tracing/send-traces/using-otel-sdk-python Installs the Flask web framework using pip. This is a prerequisite for running the Flask application. ```bash pip install flask ``` -------------------------------- ### Install AWS CDK Source: https://quickwit.io/docs/get-started/tutorials/tutorial-aws-lambda-simple Install the AWS CDK globally using npm. Ensure AWS credentials are configured. ```bash npm install -g aws-cdk ``` -------------------------------- ### Launch Quickwit Services Source: https://quickwit.io/docs/ingest-data/kafka Execute this command to start Quickwit in server mode, which includes launching both the indexer and searcher services. ```bash # Launch Quickwit services. ./quickwit run ``` -------------------------------- ### Conjunction Query Example Source: https://quickwit.io/docs/reference/query-language Example of a conjunction query using the 'AND' operator. Matches documents only if both clauses are true. ```plaintext clause1 AND clause2 ``` -------------------------------- ### Create Quickwit Index Source: https://quickwit.io/docs/guides/add-full-text-search-to-your-olap-db Creates a Quickwit index using a specified configuration file. This command should be run after starting the Quickwit server. ```bash curl -o gh-archive-index-config.yaml https://raw.githubusercontent.com/quickwit-oss/quickwit/main/config/tutorials/gh-archive/index-config-for-clickhouse.yaml ./quickwit index create --index-config gh-archive-index-config.yaml ``` -------------------------------- ### Install OpenTelemetry Dependencies Source: https://quickwit.io/docs/distributed-tracing/send-traces/using-otel-sdk-python Installs the necessary OpenTelemetry packages for Python, including the distribution, OTLP exporter, and bootstrap tools. ```bash pip install opentelemetry-distro pip install opentelemetry-exporter-otlp ``` -------------------------------- ### Run Quickwit Server with Docker Source: https://quickwit.io/docs/log-management/send-logs/using-vector Starts a Quickwit server instance using Docker, mounting a local directory for data persistence. Port 7280 is exposed for API access. ```bash # Create Quickwit data dir. mkdir qwdata docker run --rm -v $(pwd)/qwdata:/quickwit/qwdata -p 7280:7280 quickwit/quickwit run ``` -------------------------------- ### Start Quickwit Server using Docker Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs Run Quickwit in a Docker container, mounting a local directory for data persistence and exposing the default port. ```bash docker run --rm -v $(pwd)/qwdata:/quickwit/qwdata -p 127.0.0.1:7280:7280 quickwit/quickwit run ``` -------------------------------- ### Example Aggregation Request and Response Source: https://quickwit.io/docs/reference/aggregation This example demonstrates a request for terms aggregation with a nested average aggregation, and its corresponding response. ```APIDOC ## Example Aggregation Request and Response ### Request ```json { "query": "*", "max_hits": 0, "aggs": { "sites_and_aqi": { "terms": { "field": "County", "size": 2, "order": { "average_aqi": "asc" } }, "aggs": { "average_aqi": { "avg": { "field": "AQI" } } } } } } ``` ### Response ```json { ... "aggregations": { "sites_and_aqi": { "buckets": [ { "average_aqi": { "value": 32.62267569707098 }, "doc_count": 56845, "key": "臺東縣" }, { "average_aqi": { "value": 35.97893635571055 }, "doc_count": 28675, "key": "花蓮縣" } ], "sum_other_doc_count": 1872055 } } } ``` ``` -------------------------------- ### Phrase Query Example Source: https://quickwit.io/docs/reference/query-language Example of a phrase query. Matches documents where the exact sequence of words appears in the specified field. ```plaintext field:"sequence of words" ``` -------------------------------- ### Download StackOverflow Dataset Source: https://quickwit.io/docs/ingest-data/ingest-api Download a sample of the StackOverflow dataset to ingest into Quickwit. ```bash # Download the first 10_000 Stackoverflow posts articles. curl -O https://quickwit-datasets-public.s3.amazonaws.com/stackoverflow.posts.transformed-10000.json ``` -------------------------------- ### Multi Search Request Body Example Source: https://quickwit.io/docs/reference/es_compatible_api Example of a multi-search request body, specifying different indices and queries for concurrent execution. ```json {"index": "gharchive" } {"query" : {"match" : { "author.login": "fulmicoton"}}} {"index": "gharchive"} {"query" : {"match_all" : {}}} ``` -------------------------------- ### Negation Query Examples Source: https://quickwit.io/docs/reference/query-language Examples of negation queries using 'NOT' or the '-' prefix. Matches documents where the specified clause does not match. ```plaintext NOT clause -clause ``` -------------------------------- ### Download and Index Sample Dataset via cURL Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs Download the sample dataset using wget and then ingest it using a cURL POST request to the Quickwit API. This method bypasses the CLI/Docker ingest commands. ```bash wget https://quickwit-datasets-public.s3.amazonaws.com/hdfs-logs-multitenants-10000.json curl -XPOST http://localhost:7280/api/v1/hdfs-logs/ingest -H "content-type: application/json" --data-binary @hdfs-logs-multitenants-10000.json ``` -------------------------------- ### Disjunction Query Example Source: https://quickwit.io/docs/reference/query-language Example of a disjunction query using the 'OR' operator. Matches documents if at least one of the clauses is true. ```plaintext clause1 OR clause2 ``` -------------------------------- ### Exists Query Example Source: https://quickwit.io/docs/reference/query-language Example of an exists query. Matches documents where the specified field is set. Requires a field to be explicitly provided. ```plaintext field:* ``` -------------------------------- ### Datetime Field Mapping Example Source: https://quickwit.io/docs/configuration/index-config Example mapping for a datetime field, specifying input formats, output format, and storage/indexing options. ```yaml name: timestamp type: datetime description: Time at which the event was emitted input_formats: - rfc3339 - unix_timestamp - "%Y %m %d %H:%M:%S.%f %z" output_format: unix_timestamp_secs stored: true indexed: true fast: true fast_precision: milliseconds ``` -------------------------------- ### Quickwit Index Configuration (YAML) Source: https://quickwit.io/docs/get-started/quickstart This is an example of a Quickwit index configuration file. It specifies index settings, document mapping with field definitions, and search configurations. ```yaml # # Index config file for stackoverflow dataset. # version: 0.7 index_id: stackoverflow doc_mapping: field_mappings: - name: title type: text tokenizer: default record: position stored: true - name: body type: text tokenizer: default record: position stored: true - name: creationDate type: datetime fast: true input_formats: - rfc3339 fast_precision: seconds timestamp_field: creationDate search_settings: default_search_fields: [title, body] indexing_settings: commit_timeout_secs: 30 ``` -------------------------------- ### Index Sample Dataset via CLI Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs Ingest a smaller sample dataset (10,000 documents) using the CLI. This is a faster alternative for testing and examples. ```bash curl https://quickwit-datasets-public.s3.amazonaws.com/hdfs-logs-multitenants-10000.json | ./quickwit index ingest --index hdfs-logs ``` -------------------------------- ### Run Quickwit Node Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs-distributed-search-aws-s3 Starts the Quickwit node using the generated configuration file. This command assumes the Quickwit binary is in the current directory. ```bash ./quickwit run --config config.yaml ``` -------------------------------- ### Search in an Index (GET) Source: https://quickwit.io/docs/reference/rest-api Search for documents matching a query in a specific index using a GET request. Parameters are URL parameters. ```http GET api/v1//search?query=searchterm ``` -------------------------------- ### Run Quickwit Docker on Apple Silicon Source: https://quickwit.io/docs/get-started/quickstart If you are on an Apple Silicon based macOS, you may need to specify the platform for the Docker image. Jemalloc warnings can be safely ignored. ```bash docker run --rm --platform linux/amd64 quickwit/quickwit --version ``` -------------------------------- ### Exclusive Range Query Example Source: https://quickwit.io/docs/reference/query-language Example of an exclusive range query for an 'ip' field. Matches IP addresses strictly between 127.0.0.1 and 127.0.0.50. ```plaintext ip:{127.0.0.1 TO 127.0.0.50} ``` -------------------------------- ### Configure and Run Third Quickwit Node Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs-distributed-search-aws-s3 Create a configuration file for the third Quickwit node, similar to the second, and start its searcher service. This node will also connect to the first node as a peer seed. ```yaml # configuration for our third node echo "version: 0.7 node_id: searcher-3 listen_address: 0.0.0.0 peer_seeds: - ${IP_NODE_1} # searcher-1 metastore_uri: ${S3_PATH} default_index_root_uri: ${S3_PATH} " > config.yaml # Start a Quickwit searcher. ./quickwit run --service searcher --config config.yaml ``` -------------------------------- ### Create Index using CLI Source: https://quickwit.io/docs/get-started/tutorials/tutorial-hdfs-logs Create a new index in Quickwit using the CLI command with the specified index configuration file. ```bash ./quickwit index create --index-config hdfs_logs_index_config.yaml ```