$ conda create --name --clone base
$ ipython kernel install --name --user
export http_proxy="xyz" export https_proxy="xyz"
| apiVersion: kibana.k8s.elastic.co/v1 | |
| kind: Kibana | |
| metadata: | |
| namespace: dev | |
| name: nachiket | |
| spec: | |
| version: 7.17.1 | |
| count: 1 | |
| elasticsearchRef: | |
| name: nachiket | 
| apiVersion: elasticsearch.k8s.elastic.co/v1 | |
| kind: Elasticsearch | |
| metadata: | |
| name: nachiket | |
| namespace: dev | |
| spec: | |
| version: 7.17.1 | |
| nodeSets: | |
| - name: controlplane | |
| count: 3 | 
| # Bucket Selector Query | |
| Suppose we need to find a scenario where multiple users are logging in from a single source IP. We would write a query to do the following: | |
| 1. Query and filter the event id you need | |
| 2. Aggregate the results by ip addresses | |
| 3. Aggregate the output of ip addresses by the users | |
| 4. Select only the buckets that cross our threshold (In our case 10) | |
| We could easily write a query to do this in dev_tools as follows: | |
| ``` | 
| import collections.abc | |
| import yaml | |
| # Flatten the yaml dictionary into a set of strings | |
| # https://stackoverflow.com/a/6027615/10922298 | |
| def flatten(d, parent_key='', sep='.'): | |
| items = [] | |
| for k, v in d.items(): | |
| new_key = parent_key + sep + k if parent_key else k | |
| if isinstance(v, collections.MutableMapping): | 
| import logging.config | |
| import os | |
| from django.utils.log import DEFAULT_LOGGING | |
| # Disable Django's logging setup | |
| LOGGING_CONFIG = None | |
| LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper() | |
| logging.config.dictConfig({ | 
Within infinite myths lies the eternal truth
Who sees it all?
Varuna has but a thousand eyes,
Indra has a hundred,
You and I, only two.
- Devdutt Pattanaik
 
Normal Text
  Some Links:
  
 
  Link 3