-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.d.ts
More file actions
60 lines (53 loc) · 1.63 KB
/
Copy pathindex.d.ts
File metadata and controls
60 lines (53 loc) · 1.63 KB
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
import { Client, ClientOptions, estypes } from '@opensearch-project/opensearch';
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 OpensearchTransportOptions extends TransportStream.TransportStreamOptions {
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;
dataStream?: boolean;
}
export class OpensearchTransport extends TransportStream {
constructor(opts?: OpensearchTransportOptions);
flush(): Promise<any>;
query<T>(options: any, callback?: () => void): Promise<estypes.SearchResponse<T>>;
query<T>(q: string): Promise<estypes.SearchResponse<T>>;
getIndexName(opts: OpensearchTransportOptions): string;
}
interface TransformedData {
'@timestamp': string;
message: string;
severity: string;
fields: string;
transaction?: { id: string };
trace?: { id: string };
span?: { id: string };
}
export function OpensearchTransformer(logData: LogData): TransformedData;