Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Add already mapped log index fields to list of mapping options #845

Conversation

amsiglan
Copy link
Collaborator

Description

When we have automatically mapped fields, if the user removes the mapped log index field, then it is not added back to the list of available options and user cannot add the same field back without a workaround.

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Copy link

codecov bot commented Dec 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7837a99) 31.03% compared to head (c370f3d) 31.03%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #845   +/-   ##
=======================================
  Coverage   31.03%   31.03%           
=======================================
  Files         151      151           
  Lines        5111     5113    +2     
  Branches      948      895   -53     
=======================================
+ Hits         1586     1587    +1     
- Misses       3335     3336    +1     
  Partials      190      190           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eirsep
Copy link
Member

eirsep commented Feb 6, 2024

plz udpate the PR description and use the exact terminologies like Mapped Fields and Available Fields

If i understood this.. this pr seems to move a field from Mapped field to Available fields if the user removes the automatical mapping

is that right??

@amsiglan
Copy link
Collaborator Author

amsiglan commented Feb 7, 2024

plz udpate the PR description and use the exact terminologies like Mapped Fields and Available Fields

If i understood this.. this pr seems to move a field from Mapped field to Available fields if the user removes the automatical mapping

is that right??

No, all this change does is make sure if the user deselects the provided automatic mapping, they can select that option again. Currently, we end up removing that option altogether

@amsiglan amsiglan merged commit e9ac83d into opensearch-project:main Feb 7, 2024
14 of 19 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 7, 2024
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit e9ac83d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.9 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security-analytics-dashboards-plugin/backport-2.9 2.9
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.9
# Create a new branch
git switch --create backport-845-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e9ac83da0ccb80ae5ecb133e41490fa5d69660c0
# Push it to GitHub
git push --set-upstream origin backport-845-to-2.9
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.9

Then, create a pull request where the base branch is 2.9 and the compare/head branch is backport-845-to-2.9.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security-analytics-dashboards-plugin/backport-2.10 2.10
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.10
# Create a new branch
git switch --create backport-845-to-2.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e9ac83da0ccb80ae5ecb133e41490fa5d69660c0
# Push it to GitHub
git push --set-upstream origin backport-845-to-2.10
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.10

Then, create a pull request where the base branch is 2.10 and the compare/head branch is backport-845-to-2.10.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.11 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security-analytics-dashboards-plugin/backport-2.11 2.11
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.11
# Create a new branch
git switch --create backport-845-to-2.11
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e9ac83da0ccb80ae5ecb133e41490fa5d69660c0
# Push it to GitHub
git push --set-upstream origin backport-845-to-2.11
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.11

Then, create a pull request where the base branch is 2.11 and the compare/head branch is backport-845-to-2.11.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.12 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security-analytics-dashboards-plugin/backport-2.12 2.12
# Navigate to the new working tree
pushd ../.worktrees/security-analytics-dashboards-plugin/backport-2.12
# Create a new branch
git switch --create backport-845-to-2.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e9ac83da0ccb80ae5ecb133e41490fa5d69660c0
# Push it to GitHub
git push --set-upstream origin backport-845-to-2.12
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security-analytics-dashboards-plugin/backport-2.12

Then, create a pull request where the base branch is 2.12 and the compare/head branch is backport-845-to-2.12.

amsiglan pushed a commit that referenced this pull request Feb 7, 2024
(cherry picked from commit e9ac83d)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
amsiglan added a commit to amsiglan/security-analytics-dashboards-plugin that referenced this pull request Feb 14, 2024
…oject#845)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@amsiglan amsiglan mentioned this pull request Feb 14, 2024
1 task
amsiglan added a commit that referenced this pull request Feb 14, 2024
* Make notifications optional (#796)

* Make notifications optional 2.11 (#770)

* Threat intel feed support for detector creation (#762)

* added threat intel feed support for detector creation

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated cypress workflow file

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated alerts; findings UX

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* refactored alert condition panel; update detector for intel feeds

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated snapshots, mocks

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated workflow

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated snapshot

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* updated UI; tests

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed tests; make notification optional

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* revert notification change

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* supporting array of key/value under selection (#803)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* Correlation rules field matching and time window support (#804)

* added ux for group by field and time window

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* improved validation

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* check for null values

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* addressed PR comments

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* validate fields only when group by enabled; update default window to 5 min (#810)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* do not send fields if empty (#817)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* Allow empty field name for supporting timeframe and keywords when validating rule during creation/update (#823)

* allow empty field name for supporting timeframe and keywords

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed cypress test

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* fixed update payload (#838)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

* add already mapped log index fields to list of options (#845)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants