# Correlation

{% embed url="<https://www.youtube.com/watch?v=1knf6Ou_phY>" %}

Correlation allows you to link steps together. For instance, you can design a test scenario to evaluate your authentication process by taking the following steps: First, obtain the authentication token from the response of a login request. Then, insert the extracted token into subsequent requests. This short example demonstrates how correlation works in practice.

#### Capture Value from the Response

1. Click the ***More*** button located to the right of the step and open the "Step Details" section.

   <figure><img src="/files/DiIn6jSfXnC8Hrvfd8EM" alt=""><figcaption><p>Step Detail Button </p></figcaption></figure>
2. To capture a value from the response of a step, go to the "Capture" tab in the "Step Detail" section and follow these steps:

   * Give a unique name to a variable that you will use to access the captured value in subsequent requests.
   * Select whether to extract the value from the response body or response headers.
   * Choose the appropriate extraction type based on where you extract the value.
   * If you're extracting from the response body, you can use JSON path, XML path, or regular expressions to extract the value.
   * If you're extracting from response headers, you can extract the entire header value or a part of the header value by using regular expressions.

   <div><figure><img src="/files/VBkvO9ExFzTSUBddNGQp" alt=""><figcaption></figcaption></figure> <figure><img src="/files/ty5qZ0J12safN2GgJid1" alt=""><figcaption></figcaption></figure></div>

#### Use Captured Value in Requests

You can use the format {{captured\_variable\_name}} to insert a value that was previously captured into various parts of subsequent requests. This includes the URL, the request body, query parameters, headers, and authentication information.

<figure><img src="/files/YezV8RLIyEidMMVAhLB1" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ddosify.com/ddosify/performance-testing/correlation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
