-
Notifications
You must be signed in to change notification settings - Fork 131
/
index.d.ts
61 lines (54 loc) · 1.66 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { Client, ClientOptions, estypes } 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 {
dataStream?: boolean;
apm?: any; // typeof Agent;
timestamp?: () => string;
level?: string;
index?: string;
indexPrefix?: string | Function;
indexSuffixPattern?: string;
transformer?: Transformer;
useTransformer?: boolean;
indexTemplate?: { [key: string]: any };
ensureIndexTemplate?: boolean;
flushInterval?: number;
waitForActiveShards?: number | 'all';
handleExceptions?: boolean;
pipeline?: string;
client?: Client;
clientOpts?: ClientOptions;
buffering?: boolean;
bufferLimit?: number;
healthCheckTimeout?: string;
healthCheckWaitForStatus?: string;
healthCheckWaitForNodes?: string;
source?: string;
retryLimit?: number;
}
export class ElasticsearchTransport extends TransportStream {
constructor(opts?: ElasticsearchTransportOptions);
flush(): Promise<any>;
query<T>(options: any, callback?: () => void): Promise<estypes.SearchResponse<T>>;
query<T>(q: string): Promise<estypes.SearchResponse<T>>;
getIndexName(opts: ElasticsearchTransportOptions): string;
}
interface TransformedData {
'@timestamp': string
message: string
severity: string
fields: string
transaction?: { id: string }
trace?: { id: string }
span?: { id: string }
}
export function ElasticsearchTransformer(logData: LogData): TransformedData;