[Elastic] Elastic Contributor Program - 2022, 2021

Elastic 2022. 2. 10. 13:03

2022년에는 방식이 변경 된다고 해서 활동을 거의 하지 않았는데 다행히 Bronze 를 주셨네요. ^^

참여 하고 싶으신 분들은 아래 링크 통해서 하시면 됩니다.

 

https://contributor-program.app.elstc.co/

Elastic Bronze Contributor 2022

 

Elastic Bronze Contributor 2021

:

[Elasticsearch] Exists Query...

Elastic/Elasticsearch 2022. 1. 28. 11:44

공식 문서)

Exists query | Elasticsearch Guide [7.16] | Elastic

 

exists query 는 field 자체가 아래 이유등으로 인해 생성 되자 않는 문서를 찾습니다.

즉, 

- null 또는 empty array (빈문자열 "" 은 해당 되지 않습니다.)

- index: false

- ignore_above 설정 값을 넘었을 때

- ignore_malformed 설정에 걸렸을 때

 

검색 엔진 특성상 null, empty string 에 대해서는 전처리를 통해서 명확히 제거 하거나 목적에 맞게 변형 하는 것이 좋습니다.

 

검색엔진을 이용해서 field:"" 또는 field: " " 과 같은 질의를 작성 하는 것은 좋지 않습니다.

 

:

[Elasticsearch] Aggs - Cardinality, Derivative, Cumulative...

Elastic/Elasticsearch 2022. 1. 28. 11:37

공식 문서)

Cardinality aggregation | Elasticsearch Guide [7.16] | Elastic

Derivative aggregation | Elasticsearch Guide [7.16] | Elastic

Cumulative cardinality aggregation | Elasticsearch Guide [7.16] | Elastic

 

현재 값과 직전 값에 대한 차이를 구합니다.

공식 문서에 자세한 내용들이 나와 있으니 보시면 좋습니다.

 

제가 사용 했던 예제는 공식 문서에 있는 거 활용 했습니다.

 

DAU 를 cardinality aggs 로 구하고 

Daily DAU 에 대한 누적 카운트를 cumulative_cardinality aggs 로 구하고 (여기서 buckets_path 는 cardinality aggs) 

Daily DAU 에 대한 변화를 derivative aggs 로 구했습니다. (여기서 buckets_path 는 cumulative_cardinality aggs)

 

아래는 공식 문서 예제 올려 둔 내용입니다.

GET /user_hits/_search
{
  "size": 0,
  "aggs": {
    "users_per_day": {
      "date_histogram": {
        "field": "timestamp",
        "calendar_interval": "day"
      },
      "aggs": {
        "distinct_users": {
          "cardinality": {
            "field": "user_id"
          }
        },
        "total_new_users": {
          "cumulative_cardinality": {
            "buckets_path": "distinct_users" 
          }
        }
      }
    }
  }
}

 

:

[Python] pyenv install from local tar.xz 설치 하기.

ITWeb/개발일반 2022. 1. 24. 12:12

맥북 기준으로 작성 합니다.

 

$HOME/.pyenv/cache

위 경로에 설치 하고자 하는 python tar.xz 파일을 다운로드 받아서 넣어 두고 진행을 하면 됩니다.

 

$ wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz 

$ mv ~/Downloads/Python-3.9.9.tar.xz ~/.pyenv/cache/

$ pyenv install 3.9.9

 

이와 같이 하면 설치가 가능 합니다.

사내 보안 정책으로 설치가 안될 경우 활용 하면 됩니다.

 

:

[Gradle] configurations 를 이용한 log4j dependency 반영

ITWeb/개발일반 2022. 1. 24. 11:40

최근에 발생한 log4j 보안 이슈로 인해서 patch 작업이 필요 했었는데요.

build.gradle 에서 configurations 를 이용해서 쉽게 적용 할 수 있는 방법인데 기억하기 위해 이것도 기록해 봅니다.

 

관련 보안 내용은 아래 링크 참고 하시면 됩니다.

Log4j – Apache Log4j Security Vulnerabilities

 

Log4j – Apache Log4j Security Vulnerabilities

<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apa

logging.apache.org

build.gradle)

configuration {
  all {
  	resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    	if ( details.requested.group == 'org.apache.logging.log4j' ) {
        	details.useVersion '2.17.1'
        }
    }
  }
  
  compileOnly {
    extendsFrom annotationProccessor
  }
}

 

: