# @types/splunk-logging

> TypeScript definitions for splunk-logging

Latest version **0.11.8** (published 2025-03-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/splunk-logging
pnpm add @types/splunk-logging
yarn add @types/splunk-logging
bun add @types/splunk-logging
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.11.8 |
| Published | 2025-03-22 |
| First published | 2018-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51431 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/splunk-logging
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/splunk-logging
- npm.io page: https://npm.io/package/@types/splunk-logging

## Dependencies (1)

- [@types/request](https://npm.io/package/@types/request.md) *

## Recent versions

- 0.11.8 (latest) — 2025-03-22
- 0.11.6 (ts4.7) — 2024-04-18
- 0.11.4 (ts4.6) — 2023-11-07
- 0.11.1 (ts4.3) — 2023-04-18
- 0.11.0 (ts4.2) — 2021-12-02
- 0.9.2 (ts3.6) — 2021-07-06
- 0.9.1 (ts2.8) — 2018-07-06
- 0.11.7 — 2025-03-18
- 0.11.5 — 2024-04-08
- 0.11.3 — 2023-10-18
- 0.11.2 — 2023-09-25
- 0.9.0 — 2018-07-04

## README

# Installation
> `npm install --save @types/splunk-logging`

# Summary
This package contains type definitions for splunk-logging (http://dev.splunk.com).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/splunk-logging.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/splunk-logging/index.d.ts)
````ts
import { CoreOptions as RequestOptions } from "request";

export {};

export type Severity = "debug" | "info" | "warn" | "error";

// this enum isn't actually exported, but it is used as an internal value by the Logger.
declare enum SeverityLevel {
    DEBUG = "debug",
    INFO = "info",
    WARN = "warn",
    ERROR = "error",
}

export interface Config {
    token: string;
    name?: string | undefined;
    host?: string | undefined;
    maxRetries?: number | undefined;
    path?: string | undefined;
    protocol?: "http" | "https" | undefined;
    port?: number | undefined;
    url?: string | undefined;
    level?: Severity | string | undefined;
    batchInterval?: number | undefined;
    maxBatchSize?: number | undefined;
    maxBatchCount?: number | undefined;
}

export interface SendContextMetadata {
    host?: string | undefined;
    index?: string | undefined;
    source?: string | undefined;
    sourcetype?: string | undefined;
    time?: number | undefined; // Milliseconds since epoch, e.g. with Date.now()
}

export interface SendContext {
    message: any;
    severity?: Severity | string | undefined;
    metadata?: SendContextMetadata | undefined;
}

export type Callback = (error: Error | undefined, req: any, res: any) => void;
export type EventFormatter = (message: any, severity: string) => any;

export class Logger {
    error: (error: Error, context: SendContext) => void;
    eventFormatter: EventFormatter;
    requestOptions: RequestOptions;
    readonly serializedContextQueue: any[];
    readonly levels: typeof SeverityLevel;

    constructor(config: Config);

    flush(callback?: Callback): void;
    send(context: SendContext, callback?: Callback): void;
}

````

### Additional Details
 * Last updated: Sat, 22 Mar 2025 08:35:34 GMT
 * Dependencies: [@types/request](https://npmjs.com/package/@types/request)

# Credits
These definitions were written by [Alex Brick](https://github.com/bricka), and [Borui Gu](https://github.com/BoruiGu).

---
_Source: https://npm.io/package/@types/splunk-logging · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
