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

Reduce log level for informative message #203

Merged

Conversation

eht16
Copy link
Contributor

@eht16 eht16 commented Dec 17, 2022

Description

In org.opensearch.securityanalytics.indexmanagment/DetectorIndexManagementService there is a log message "info deleteOldIndices" which is more of a trace but it is logged with level error.

In my logs see the following entries (repeated every 12 hours):

Dec 17 11:26:39 hostname opensearch[104377]: [INFO ][o.o.a.t.CronTransportAction] [n1-kalgo] Start running AD hourly cron.
Dec 17 11:26:39 hostname opensearch[104377]: [INFO ][o.o.a.t.ADTaskManager    ] [n1-kalgo] Start to maintain running historical tasks
Dec 17 11:26:39 hostname opensearch[104377]: [INFO ][o.o.a.c.HourlyCron       ] [n1-kalgo] Hourly maintenance succeeds
Dec 17 11:26:39 hostname opensearch[104377]: [ERROR][o.o.s.i.DetectorIndexManagementService] [n1-kalgo] info deleteOldIndices
Dec 17 11:26:39 hostname opensearch[104377]: [INFO ][o.o.s.i.DetectorIndexManagementService] [n1-kalgo] No Old Finding Indices to delete
Dec 17 11:26:39 hostname opensearch[104377]: [ERROR][o.o.s.i.DetectorIndexManagementService] [n1-kalgo] info deleteOldIndices
Dec 17 11:26:39 hostname opensearch[104377]: [INFO ][o.o.s.i.DetectorIndexManagementService] [n1-kalgo] No Old Alert Indices to delete
Dec 17 11:26:39 hostname opensearch[104377]: [INFO ][o.o.i.i.IndexStateManagementHistory] [n1-kalgo] No Old History Indices to delete

This is fine except the "info deleteOldIndices" which is logged as error but seems like an info or debug message, unless I'm missing anything.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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.

@eht16 eht16 requested a review from a team December 17, 2022 12:23
Copy link
Member

@getsaurabh02 getsaurabh02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eht16 for taking a stab on it. LGTM.

@codecov-commenter
Copy link

codecov-commenter commented Dec 28, 2022

Codecov Report

Merging #203 (103d28c) into main (61715cd) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               main     #203      +/-   ##
============================================
- Coverage     28.19%   28.19%   -0.01%     
  Complexity      940      940              
============================================
  Files           236      236              
  Lines          9863     9864       +1     
  Branches       1118     1118              
============================================
  Hits           2781     2781              
- Misses         6840     6841       +1     
  Partials        242      242              
Impacted Files Coverage Δ
...indexmanagment/DetectorIndexManagementService.java 0.00% <0.00%> (ø)

@getsaurabh02
Copy link
Member

@eht16 Can we fix the DCO check in the commit

@eht16 eht16 force-pushed the reduce_log_level_for_deleteoldindices branch from 8f9f3ff to de93144 Compare January 10, 2023 21:42
@eht16
Copy link
Contributor Author

eht16 commented Jan 10, 2023

@eht16 Can we fix the DCO check in the commit

@getsaurabh02 done (hopefully correctly).

@eht16
Copy link
Contributor Author

eht16 commented Jan 29, 2023

Anything else missing?

@nkonev
Copy link

nkonev commented Jul 12, 2023

@getsaurabh02 also bumped into this issue by my monitoring

can you merge this PR ?

@sbcd90
Copy link
Collaborator

sbcd90 commented Jul 12, 2023

triggering build

@sbcd90 sbcd90 merged commit e77a7d9 into opensearch-project:main Jul 12, 2023
10 of 15 checks passed
@terryquigleysas
Copy link

Hi, could someone confirm whether this change was backported for 2.9.0 or not? If it hasn't been are there plans for it to be in the 2.10.0 release?

@terryquigleysas
Copy link

@eht16 Hi, would you be able to confirm whether this change was backported for 2.9.0 or not? If it hasn't been are there plans for it to be in the 2.10.0 release?

Thanks

opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 5, 2023
Signed-off-by: Enrico Tröger <[email protected]>
(cherry picked from commit e77a7d9)
@eht16 eht16 deleted the reduce_log_level_for_deleteoldindices branch September 14, 2023 21:17
@eht16
Copy link
Contributor Author

eht16 commented Sep 14, 2023

@terryquigleysas I cannot say for sure if the change is in 2.9.0, I do not see the originally reported log messages anymore.
But now there are messages like:

opensearch[550]: [2023-09-13T12:45:12,860][ERROR][o.o.a.a.AlertIndices     ] [n1-kalgo] info deleteOldIndices

Maybe the log message was moved or so in the meantime.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-203-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e77a7d99d26ee71a4d5377bbf793d7ed16fbaf0e
# Push it to GitHub
git push --set-upstream origin backport/backport-203-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-203-to-2.x.

jowg-amazon pushed a commit to jowg-amazon/security-analytics that referenced this pull request Feb 5, 2024
jowg-amazon added a commit that referenced this pull request Feb 6, 2024
Signed-off-by: Enrico Tröger <[email protected]>
Co-authored-by: Enrico Tröger <[email protected]>
sbcd90 pushed a commit to sbcd90/security-analytics that referenced this pull request Mar 10, 2024
Signed-off-by: Joanne Wang <[email protected]>
(cherry picked from commit 4d4f5e3)

Co-authored-by: Joanne Wang <[email protected]>

Reduce log level for informative message (opensearch-project#203) (opensearch-project#833)

Signed-off-by: Enrico Tröger <[email protected]>
Co-authored-by: Enrico Tröger <[email protected]>

Updated alert creation following common-utils PR 584. (opensearch-project#837) (opensearch-project#839)

Signed-off-by: AWSHurneyt <[email protected]>
(cherry picked from commit 8adb9c3)

Co-authored-by: AWSHurneyt <[email protected]>

Release notes for 2.12.0 (opensearch-project#834) (opensearch-project#841)

* release notes for 2.12

Signed-off-by: Joanne Wang <[email protected]>

* update release notes

Signed-off-by: Joanne Wang <[email protected]>

* update release notes

Signed-off-by: Joanne Wang <[email protected]>

---------

Signed-off-by: Joanne Wang <[email protected]>
(cherry picked from commit 414484a)

Co-authored-by: Joanne Wang <[email protected]>

Remove blocking calls and change threat intel feed flow to event driven (opensearch-project#871) (opensearch-project#876)

* remove actionGet() and change threat intel feed flow to event driven

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix javadocs

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert try catch removals

Signed-off-by: Surya Sashank Nistala <[email protected]>

* use action listener wrap() in detector threat intel code paths

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add try catch

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit 172d58d)

Co-authored-by: Surya Sashank Nistala <[email protected]>

Fail the flow the when detectot type is missing in the log types index (opensearch-project#845) (opensearch-project#857)

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit 8d19912)

Co-authored-by: Megha Goyal <[email protected]>

[BUG] ArrayIndexOutOfBoundsException for inconsistent detector index behavior  (opensearch-project#843) (opensearch-project#858)

* Catch ArrayIndexOutOfBoundsException when detector is missing

Signed-off-by: Megha Goyal <[email protected]>

* Add a check on SearchHits.getHits() length

Signed-off-by: Megha Goyal <[email protected]>

* Remove index out of bounds exception

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit 0ef8543)

Co-authored-by: Megha Goyal <[email protected]>

Backport opensearch-project#873 and opensearch-project#789 (opensearch-project#895)

* support object fields in aggregation based sigma rules (opensearch-project#789)

Signed-off-by: Subhobrata Dey <[email protected]>

* Pass rule field names in doc level queries during monitor/creation. Remove blocking actionGet() calls  (opensearch-project#873)

* pass query field names in doc level queries during monitor creation/updation

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove actionGet() and change get index mapping call to event driven flow

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix chained findings monitor

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add finding mappings

Signed-off-by: Surya Sashank Nistala <[email protected]>

* remove test messages from logs

Signed-off-by: Surya Sashank Nistala <[email protected]>

* revert build.gradle change

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Subhobrata Dey <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
Co-authored-by: Subhobrata Dey <[email protected]>

Fix duplicate ecs mappings which returns incorrect log index field in mapping view API (opensearch-project#786) (opensearch-project#788) (opensearch-project#898)

* field mapping changes

* add integ test

* turn unmappedfieldaliases as set and add integ test

* add comments

* fix integ tests

* moved logic to method for better readability

---------

Signed-off-by: Joanne Wang <[email protected]>

Add throw for empty strings in rules with modifier contains, startwith, and endswith (opensearch-project#860) (opensearch-project#896)

* add validation for empty strings with contains, startswith and endswith modifiers

* throw exception if empty string with contains, startswith, or endswith

* change var name

* add modifiers to log

---------

Signed-off-by: Joanne Wang <[email protected]>

Add an "exists" check for "not" condition in sigma rules (opensearch-project#852) (opensearch-project#897)

* test design

Signed-off-by: Joanne Wang <[email protected]>

* working version

Signed-off-by: Joanne Wang <[email protected]>

* cleaning up

Signed-off-by: Joanne Wang <[email protected]>

* testing

Signed-off-by: Joanne Wang <[email protected]>

* working version

Signed-off-by: Joanne Wang <[email protected]>

* working version

Signed-off-by: Joanne Wang <[email protected]>

* refactored querybackend

Signed-off-by: Joanne Wang <[email protected]>

* working on tests

Signed-off-by: Joanne Wang <[email protected]>

* fixed alerting and finding tests

Signed-off-by: Joanne Wang <[email protected]>

* fix correlation tests

Signed-off-by: Joanne Wang <[email protected]>

* working all tests

Signed-off-by: Joanne Wang <[email protected]>

* moved test and changed alias for adldap

Signed-off-by: Joanne Wang <[email protected]>

* added more tests

Signed-off-by: Joanne Wang <[email protected]>

* cleanup code

Signed-off-by: Joanne Wang <[email protected]>

* remove exists flag

Signed-off-by: Joanne Wang <[email protected]>

---------

Signed-off-by: Joanne Wang <[email protected]>
(cherry picked from commit 656a5fe)

Co-authored-by: Joanne Wang <[email protected]>

Add goyamegh as a maintainer (opensearch-project#868) (opensearch-project#899)

Signed-off-by: Megha Goyal <[email protected]>

Refactor invocation of Action listeners in correlations (opensearch-project#880) (opensearch-project#900)

* Refactor invocation of Action listeners in correlations

* Close hanging tasks in correlations workflow

* Logging finding id and monitor id in error logs

---------

Signed-off-by: Megha Goyal <[email protected]>

Add search request timeouts for correlations workflows (opensearch-project#893) (opensearch-project#901)

* Reinstating more leaks plugged-in for correlations workflows

Signed-off-by: Megha Goyal <[email protected]>

* Add search timeouts to all correlation searches

Signed-off-by: Megha Goyal <[email protected]>

* Fix logging and exception messages

Signed-off-by: Megha Goyal <[email protected]>

* Change search timeout to 30 seconds

Signed-off-by: Megha Goyal <[email protected]>

---------

Signed-off-by: Megha Goyal <[email protected]>
(cherry picked from commit 75c4429)

Co-authored-by: Megha Goyal <[email protected]>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.7 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.7 2.7
# Navigate to the new working tree
cd .worktrees/backport-2.7
# Create a new branch
git switch --create backport/backport-203-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e77a7d99d26ee71a4d5377bbf793d7ed16fbaf0e
# Push it to GitHub
git push --set-upstream origin backport/backport-203-to-2.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.7

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

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.5 failed:

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

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.5 2.5
# Navigate to the new working tree
cd .worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-203-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e77a7d99d26ee71a4d5377bbf793d7ed16fbaf0e
# Push it to GitHub
git push --set-upstream origin backport/backport-203-to-2.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.5

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

opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 13, 2024
Signed-off-by: Enrico Tröger <[email protected]>
(cherry picked from commit e77a7d9)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 13, 2024
Signed-off-by: Enrico Tröger <[email protected]>
(cherry picked from commit e77a7d9)
engechas pushed a commit to engechas/security-analytics that referenced this pull request Mar 14, 2024
@engechas engechas mentioned this pull request Mar 15, 2024
5 tasks
engechas added a commit that referenced this pull request Mar 15, 2024
* query_field_names bugfix (#335)

Signed-off-by: Petar Dzepina <[email protected]>

* Reduce log level for informative message (#203)

Signed-off-by: Enrico Tröger <[email protected]>

* fix detector writeTo() method missing fields (#695)

* fix detector writeTo() method missing fields

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix test

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix null query filter conversion from sigma to query string query (#722)

* fix null query filter conversion from sigma to query string query

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix rule to query conversion tests for null filter

Signed-off-by: Surya Sashank Nistala <[email protected]>

* enhance test to verify non null doc doesnt match null query

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>

* Bump version 2.5.1, fix build

Signed-off-by: Chase Engelbrecht <[email protected]>

* Manual cherry-pick of #873

Signed-off-by: Chase Engelbrecht <[email protected]>

* Fix miss from manual cherry-pick

Signed-off-by: Chase Engelbrecht <[email protected]>

* Undo exceptional case not originally present

Signed-off-by: Chase Engelbrecht <[email protected]>

* Revert test from previous commit reversion

Signed-off-by: Chase Engelbrecht <[email protected]>

* Fix another miss from manual cherry-pick

Signed-off-by: Chase Engelbrecht <[email protected]>

* Revert behavior for no rules in detector

Signed-off-by: Chase Engelbrecht <[email protected]>

---------

Signed-off-by: Petar Dzepina <[email protected]>
Signed-off-by: Enrico Tröger <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: Chase Engelbrecht <[email protected]>
Co-authored-by: Petar Dzepina <[email protected]>
Co-authored-by: Enrico Tröger <[email protected]>
Co-authored-by: Surya Sashank Nistala <[email protected]>
jowg-amazon pushed a commit that referenced this pull request Mar 22, 2024
Signed-off-by: Enrico Tröger <[email protected]>
(cherry picked from commit e77a7d9)

Co-authored-by: Enrico Tröger <[email protected]>
jowg-amazon pushed a commit that referenced this pull request Mar 22, 2024
Signed-off-by: Enrico Tröger <[email protected]>
(cherry picked from commit e77a7d9)

Co-authored-by: Enrico Tröger <[email protected]>
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.

7 participants