mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[integration automatic-import] Small bugfixes (#188778)
This PR fixes two bugs that were causing failures leading to recursion timeouts when generating integrations: 1) Small prompt tweak to the related prompt instruction the LLM to include the if condition inside the processor 2) Followup fix to https://github.com/elastic/kibana/pull/187643 to also include a field null check on the processor
This commit is contained in:
parent
5adf5be1c8
commit
c27adf11da
3 changed files with 4 additions and 2 deletions
|
@ -91,7 +91,7 @@ export const ecsMappingExpectedResults = {
|
|||
description: 'Ensures the date processor does not receive an array value.',
|
||||
lang: 'painless',
|
||||
source:
|
||||
'if (ctx.mysql_enterprise.audit.timestamp instanceof ArrayList){\n ctx.mysql_enterprise.audit.timestamp = ctx.mysql_enterprise.audit.timestamp[0];\n}\n',
|
||||
'if (ctx.mysql_enterprise?.audit?.timestamp != null &&\n ctx.mysql_enterprise.audit.timestamp instanceof ArrayList){\n ctx.mysql_enterprise.audit.timestamp = ctx.mysql_enterprise.audit.timestamp[0];\n}\n',
|
||||
tag: 'script_convert_array_to_string',
|
||||
},
|
||||
},
|
||||
|
|
|
@ -37,6 +37,7 @@ export const RELATED_MAIN_PROMPT = ChatPromptTemplate.fromMessages([
|
|||
- You can add as many append processors you need to cover all the fields that you detected.
|
||||
- If conditions should always use a ? character when accessing nested fields, in case the field might not always be available, see example processors above.
|
||||
- When an if condition is not needed the argument should not be used for the processor object.
|
||||
- The if condition must be located within the processor object.
|
||||
- Do not respond with anything except the array of processors as a valid JSON objects enclosed with 3 backticks (\`), see example response below.
|
||||
</guidelines>
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@ processors:
|
|||
tag: script_convert_array_to_string
|
||||
lang: painless
|
||||
{% raw %}source: |
|
||||
if (ctx.{% endraw %}{{ value.field }}{% raw %} instanceof ArrayList){
|
||||
if (ctx.{% endraw %}{{ value.field.replaceAll('.', '?.') }}{% raw %} != null &&
|
||||
ctx.{% endraw %}{{ value.field }}{% raw %} instanceof ArrayList){
|
||||
ctx.{% endraw %}{{ value.field }}{% raw %} = ctx.{% endraw %}{{ value.field }}{% raw %}[0];
|
||||
}{% endraw %}
|
||||
- {{ key }}:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue