# Junos OS (sFlow)

To configure sFlow on a Juniper EX or QFX series switch, follow these steps:

### Access the switch CLI

Connect to your Juniper EX or QFX switch via SSH or a console cable. If connecting via SSH, use a tool like PuTTY or the built-in SSH client in your terminal, and enter the switch's IP address, username, and password to log in.

### Enter configuration mode

Once logged in, enter configuration mode by typing the following command:

```shell
configure
```

### Configure sFlow settings

To configure sFlow settings, including the sampling rate, polling interval, and the IP address and port of the remote flow collector, use the following commands:

```shell
set protocols sflow agent-id AGENT_IP_ADDRESS
set protocols sflow collector x.x.x.x udp-port yyyy
set protocols sflow polling-interval POLLING_INTERVAL
set protocols sflow sample-rate SAMPLE_RATE
set protocols sflow interfaces INTERFACE_NAME
```

Replace `AGENT_IP_ADDRESS` with the IP address of the sFlow agent (typically the switch's management IP address), `x.x.x.x` with the IP address of your ElastiFlow NetObserv Flow, `yyyy` with the desired port number for the sFlow collector (e.g., `6343`), `POLLING_INTERVAL` with the desired polling interval in seconds (e.g., `30`), `SAMPLE_RATE` with the desired sampling rate (e.g., `1024` for 1 in 1024 packets), and `INTERFACE_NAME` with the name of the interface you want to monitor (e.g., `ge-0/0/0`). You may configure multiple interfaces to be monitored.

### Commit and save the changes

After configuring the sFlow settings, commit and save the changes by entering the following commands:

```shell
commit
save
```

### Exit configuration mode

Type `exit` to leave configuration mode and return to the Juniper EX or QFX switch CLI.

### Verify the configuration

To verify that sFlow is configured correctly, use the following command:

```shell
show sflow
```

This command should display the sFlow settings you just configured.

Once you've completed these steps, your Juniper EX or QFX series switch will start exporting sFlow data to the specified ElastiFlow NetObserv Flow. Make sure NetObserv Flow is set up to receive and process the exported data for analysis and monitoring purposes.


---

# 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.elastiflow.com/additional-resources-reference-articles/guides/configuring-flow-logs-on-devices/device_flow_juniper_junos_sflow.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.
