rss
Reads an RSS feed from the specified URL and generates one record per item. Supports RSS 2.0 and Atom formats.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | None |
| License usage | Counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
rss url=STR [strip=BOOL]
Options
url=STR- URL of the RSS feed to fetch.
strip=BOOL- Whether to strip HTML tags. When set to
t, removes HTML tags from thecontentfield of each RSS item. (Default:f)
Output fields
| Field | Type | Description |
|---|---|---|
| id | integer | Sequential number of the RSS item |
| source | string | Feed source name |
| title | string | Item title |
| author | string | Item author |
| content | string | Item body text |
| link | string | Item URL |
| guid | string | Item unique identifier |
| created_at | timestamp | Item creation time |
| modified_at | timestamp | Item modification time |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 23002 | url option is required. | The url option was not specified. |
Runtime errors
| Error code | Message | Description | Action |
|---|---|---|---|
| 23001 | Cannot connect to RSS. | Unable to connect to the RSS feed URL. | Aborts the query. |
Description
The rss command downloads an RSS feed from the specified URL and converts each item into a record. When the strip option is enabled, it removes HTML tags from the content field, leaving only plain text.
Items without date information use the current time as the created_at value. Items without a guid use the link value as guid.
Examples
-
Retrieve an RSS feed
rss url="https://example.com/feed.xml"Reads the RSS feed from the specified URL and outputs all items as records.
-
Retrieve an RSS feed with HTML tags stripped
rss url="https://example.com/feed.xml" strip=tReads the RSS feed and removes HTML tags from the
contentfield. -
Search for a specific keyword in an RSS feed
rss url="https://example.com/feed.xml" strip=t | search content == "*security*"Searches for items whose body contains the word
security.