diff --git a/x-pack/plugins/infra/public/components/source_configuration/log_columns_configuration_form_state.tsx b/x-pack/plugins/infra/public/components/source_configuration/log_columns_configuration_form_state.tsx index c5398cf79ef430..0b6a92ed98507f 100644 --- a/x-pack/plugins/infra/public/components/source_configuration/log_columns_configuration_form_state.tsx +++ b/x-pack/plugins/infra/public/components/source_configuration/log_columns_configuration_form_state.tsx @@ -108,7 +108,7 @@ export const useLogColumnsConfigurationFormState = ({ const moveLogColumn = useCallback( (sourceIndex, destinationIndex) => { - if (destinationIndex >= 0 && sourceIndex < formState.logColumns.length - 1) { + if (destinationIndex >= 0 && sourceIndex <= formState.logColumns.length - 1) { const newLogColumns = [...formState.logColumns]; newLogColumns.splice(destinationIndex, 0, newLogColumns.splice(sourceIndex, 1)[0]); setFormStateChanges(changes => ({