forked from vanthome/winston-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
41 lines (36 loc) · 1.15 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Client, ClientOptions, ApiResponse } from '@elastic/elasticsearch';
import TransportStream = require('winston-transport');
export interface LogData {
message: any;
level: string;
meta: { [key: string]: any };
timestamp?: string;
}
export interface Transformer {
(logData: LogData): any;
}
export interface ElasticsearchTransportOptions extends TransportStream.TransportStreamOptions {
timestamp?: () => string;
level?: string;
index?: string;
indexPrefix?: string;
indexSuffixPattern?: string;
messageType?: string;
transformer?: Transformer;
mappingTemplate?: { [key: string]: any };
ensureMappingTemplate?: boolean;
flushInterval?: number;
waitForActiveShards?: number | 'all';
handleExceptions?: boolean;
pipeline?: string;
client?: Client;
clientOpts?: ClientOptions;
buffering?: boolean;
bufferLimit?: number;
}
export class ElasticsearchTransport extends TransportStream {
constructor(opts?: ElasticsearchTransportOptions);
query<T>(options: any, callback?: () => void): Promise<ApiResponse<T>>;
query<T>(q: string): Promise<ApiResponse<T>>;
getIndexName(opts: ElasticsearchTransportOptions): string;
}