refactored to reduce paths duplication and support custom elasticsearch for logs