Skip to content
Back to skills

098 Basic Extraction 8bf64104

ASecurity

Simple examples to get started with STDM extraction.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
code-qualitybashdebugging

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 098-basic-extraction_8bf64104 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 098 Basic Extraction 8bf64104?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 098 Basic Extraction 8bf64104
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-098-basic-extraction-8bf64104/badge)](https://www.skillsdirectory.com/skills/tools-only-098-basic-extraction-8bf64104)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Basic Extraction Examples

Simple examples to get started with STDM extraction.

## Prerequisites

1. JWT authentication configured (see [Auth Setup](../docs/auth-setup.md))
2. Consumer key set: `export SF_CONSUMER_KEY="3MVG9..."`
3. Org alias available in `sf org list`

---

## Example 1: Extract Last 7 Days

The simplest extraction - all sessions from the last 7 days:

```bash
stdm-extract extract --org prod
```

**Output structure:**
```
./stdm_data/
├── sessions/
│   └── data.parquet
├── interactions/
│   └── data.parquet
├── steps/
│   └── data.parquet
└── messages/
    └── data.parquet
```

---

## Example 2: Extract Last 24 Hours

```bash
stdm-extract extract --org prod --days 1
```

---

## Example 3: Custom Output Directory

```bash
stdm-extract extract --org prod --output /data/agentforce/prod
```

---

## Example 4: Verbose Mode

See detailed progress and timing:

```bash
stdm-extract extract --org prod --verbose
```

**Sample output:**
```
🔐 Authenticating to Data Cloud...
   Instance URL: https://myorg.my.salesforce.com

📊 Extracting sessions...
   Query: SELECT ... FROM ssot__AIAgentSession__dlm WHERE ...
   Records: 1,234 (2.3s)

📊 Extracting interactions...
   Records: 5,678 (4.1s)

📊 Extracting steps...
   Records: 12,345 (8.7s)

📊 Extracting messages...
   Records: 9,876 (5.2s)

✅ Extraction complete!
   Total records: 29,133
   Duration: 20.3s
   Output: ./stdm_data/
```

---

## Example 5: Test Authentication First

Before extracting, verify your setup:

```bash
stdm-extract test-auth --org prod
```

**Success:**
```
✅ Authentication successful
   Instance URL: https://myorg.my.salesforce.com
   Token valid for: 3599 seconds
```

**Failure:**
```
❌ Authentication failed
   Error: invalid_grant
   Hint: Check certificate expiration with:
         openssl x509 -enddate -noout -in ~/.sf/jwt/prod.key
```

---

## Example 6: Count Records Before Extraction

Check how much data exists without downloading:

```bash
stdm-extract count --org prod --dmo sessions
```

**Output:**
```
📊 Record counts for prod:
   Sessions: 12,345
```

---

## Example 7: Extract from Sandbox

Works the same as production - just use the sandbox alias:

```bash
# List your orgs
sf org list

# Extract from sandbox
stdm-extract extract --org mysandbox --days 3
```

---

## What's Next?

- [Filtered Extraction](filtered-extraction.md) - Filter by agent, date range
- [Analysis Examples](analysis-examples.md) - Analyze extracted data
- [Debugging Sessions](debugging-sessions.md) - Debug specific sessions

---

## Quick Reference

| Task | Command |
|------|---------|
| Last 7 days | `stdm-extract extract --org prod` |
| Last N days | `stdm-extract extract --org prod --days N` |
| Test auth | `stdm-extract test-auth --org prod` |
| Check counts | `stdm-extract count --org prod` |
| Verbose mode | Add `--verbose` to any command |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.