Skip to content

Commit 39ec065

Browse files
Merge branch '7.9' into backport/7.9/pr-74409
2 parents 1863437 + e5a6d56 commit 39ec065

20 files changed

Lines changed: 91 additions & 51 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"**/istanbul-instrumenter-loader/schema-utils": "1.0.0",
9393
"**/image-diff/gm/debug": "^2.6.9",
9494
"**/load-grunt-config/lodash": "^4.17.20",
95+
"**/node-jose/node-forge": "^0.10.0",
9596
"**/react-dom": "^16.12.0",
9697
"**/react": "^16.12.0",
9798
"**/react-test-renderer": "^16.12.0",
@@ -228,7 +229,7 @@
228229
"mustache": "2.3.2",
229230
"ngreact": "0.5.1",
230231
"node-fetch": "1.7.3",
231-
"node-forge": "^0.9.1",
232+
"node-forge": "^0.10.0",
232233
"opn": "^5.5.0",
233234
"oppsy": "^2.0.0",
234235
"pegjs": "0.10.0",
@@ -365,7 +366,7 @@
365366
"@types/moment-timezone": "^0.5.12",
366367
"@types/mustache": "^0.8.31",
367368
"@types/node": ">=10.17.17 <10.20.0",
368-
"@types/node-forge": "^0.9.0",
369+
"@types/node-forge": "^0.9.5",
369370
"@types/normalize-path": "^3.0.0",
370371
"@types/opn": "^5.1.0",
371372
"@types/pegjs": "^0.10.1",

src/legacy/server/logging/log_format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default class TransformObjStream extends Stream.Transform {
9191
method: event.method || '',
9292
headers: event.headers,
9393
remoteAddress: source.remoteAddress,
94-
userAgent: source.remoteAddress,
94+
userAgent: source.userAgent,
9595
referer: source.referer,
9696
};
9797

src/legacy/server/logging/log_format_json.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ describe('KbnLoggerJsonFormat', () => {
6565
},
6666
};
6767
const result = await createPromiseFromStreams([createListStream([event]), format]);
68-
const { type, method, statusCode, message } = JSON.parse(result);
68+
const { type, method, statusCode, message, req } = JSON.parse(result);
6969

7070
expect(type).toBe('response');
7171
expect(method).toBe('GET');
7272
expect(statusCode).toBe(200);
7373
expect(message).toBe('GET /path/to/resource 200 12000ms - 13.0B');
74+
expect(req.remoteAddress).toBe('127.0.0.1');
75+
expect(req.userAgent).toBe('Test Thing');
7476
});
7577

7678
it('ops', async () => {

x-pack/plugins/index_management/server/lib/fetch_indices.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ async function fetchIndicesCall(
4444
// This call retrieves alias and settings (incl. hidden status) information about indices
4545
const indices: GetIndicesResponse = await callAsCurrentUser('transport.request', {
4646
method: 'GET',
47-
path: `/${indexNamesString}`,
47+
// transport.request doesn't do any URI encoding, unlike other JS client APIs. This enables
48+
// working with Logstash indices with names like %{[@metadata][beat]}-%{[@metadata][version]}.
49+
path: `/${encodeURIComponent(indexNamesString)}`,
4850
query: {
4951
expand_wildcards: 'hidden,all',
5052
},

x-pack/plugins/logstash/public/application/components/pipeline_editor/pipeline_editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ class PipelineEditorUi extends React.Component {
125125

126126
onPipelineSave = () => {
127127
const { pipelineService, toastNotifications, intl } = this.props;
128-
const { id } = this.state.pipeline;
128+
const { id, ...pipelineToStore } = this.state.pipeline;
129129
return pipelineService
130130
.savePipeline({
131131
id,
132-
upstreamJSON: this.state.pipeline,
132+
upstreamJSON: pipelineToStore,
133133
})
134134
.then(() => {
135135
toastNotifications.addSuccess(

x-pack/plugins/logstash/server/models/pipeline/pipeline.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import { i18n } from '@kbn/i18n';
1111

1212
interface PipelineOptions {
1313
id: string;
14-
description: string;
14+
description?: string;
1515
pipeline: string;
1616
username?: string;
1717
settings?: Record<string, any>;
1818
}
1919

2020
interface DownstreamPipeline {
21-
description: string;
21+
description?: string;
2222
pipeline: string;
2323
settings?: Record<string, any>;
2424
}
@@ -27,7 +27,7 @@ interface DownstreamPipeline {
2727
*/
2828
export class Pipeline {
2929
public readonly id: string;
30-
public readonly description: string;
30+
public readonly description?: string;
3131
public readonly username?: string;
3232
public readonly pipeline: string;
3333
private readonly settings: Record<string, any>;

x-pack/plugins/logstash/server/routes/pipeline/save.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ export function registerPipelineSaveRoute(router: IRouter, security?: SecurityPl
2222
id: schema.string(),
2323
}),
2424
body: schema.object({
25-
id: schema.string(),
26-
description: schema.string(),
25+
description: schema.maybe(schema.string()),
2726
pipeline: schema.string(),
2827
settings: schema.maybe(schema.object({}, { unknowns: 'allow' })),
2928
}),

x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222

2323
import { MlTooltipComponent } from '../../application/components/chart_tooltip';
2424
import { SwimLanePagination } from './swimlane_pagination';
25-
import { SWIMLANE_TYPE } from './explorer_constants';
2625
import { ViewBySwimLaneData } from './explorer_utils';
2726

2827
/**
@@ -94,7 +93,6 @@ export const SwimlaneContainer: FC<
9493
(showSwimlane || isLoading) &&
9594
swimlaneLimit !== undefined &&
9695
onPaginationChange &&
97-
props.swimlaneType === SWIMLANE_TYPE.VIEW_BY &&
9896
fromPage &&
9997
perPage;
10098

x-pack/plugins/ml/public/application/routing/routes/explorer.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,8 @@ const ExplorerUrlStateManager: FC<ExplorerUrlStateManagerProps> = ({ jobsWithTim
189189
loadExplorerData({
190190
...loadExplorerDataConfig,
191191
swimlaneLimit:
192-
explorerState?.viewBySwimlaneData &&
193-
isViewBySwimLaneData(explorerState?.viewBySwimlaneData)
194-
? explorerState?.viewBySwimlaneData.cardinality
195-
: undefined,
192+
isViewBySwimLaneData(explorerState?.viewBySwimlaneData) &&
193+
explorerState?.viewBySwimlaneData.cardinality,
196194
});
197195
}
198196
}, [JSON.stringify(loadExplorerDataConfig)]);

x-pack/plugins/ml/public/application/services/results_service/results_service.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ export function resultsServiceProvider(mlApiServices) {
8787
},
8888
},
8989
aggs: {
90+
jobsCardinality: {
91+
cardinality: {
92+
field: 'job_id',
93+
},
94+
},
9095
jobId: {
9196
terms: {
9297
field: 'job_id',
@@ -147,6 +152,7 @@ export function resultsServiceProvider(mlApiServices) {
147152
});
148153
obj.results[jobId] = resultsForTime;
149154
});
155+
obj.cardinality = resp.aggregations?.jobsCardinality?.value ?? 0;
150156

151157
resolve(obj);
152158
})

0 commit comments

Comments
 (0)