This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (doc.containsKey('event_name.keyword') && doc['event_name.keyword'].size() > 0) { | |
String eventName = doc['event_name.keyword'].value; | |
String apenasNumeros = ""; | |
if (doc.containsKey('user_id.keyword') && doc['user_id.keyword'].size() > 0) { | |
String userId = doc['user_id.keyword'].value; | |
if (userId != null && !userId.isEmpty()) { | |
for (int i = 0; i < userId.length(); i++) { | |
char c = userId.charAt(i); | |
if (Character.isDigit(c)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /_sql?format=txt | |
{ | |
"query": """ | |
SELECT payload_parsed.externalId, COUNT(*) as ocurrences FROM "TABLE" // "TABLE*" | |
WHERE payload_parsed.type.keyword = 'MESSAGE_STATUS' | |
AND event_data.source.keyword = 'ZENVIA' | |
AND payload_parsed.channel.keyword = 'email' | |
AND payload_parsed.messageStatus.code.keyword = 'SENT' | |
AND inserted_date >= NOW() - INTERVAL 48 HOUR | |
GROUP BY payload_parsed.externalId HAVING COUNT(*) > 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String token = null; | |
// Primeiro, verificar em params._source['utm_case']['token'] | |
if (params._source.containsKey('utm_case') && params._source['utm_case'] != null) { | |
if (params._source['utm_case'].containsKey('token')) { | |
token = params._source['utm_case']['token']; | |
// Processar o JWT se o token for encontrado | |
int firstDot = token.indexOf("."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST /events_new-dedicated-01_click/_search | |
{ | |
"sort": [ | |
{ | |
"inserted_date": { | |
"order": "desc", | |
"format": "strict_date_optional_time", | |
"unmapped_type": "boolean" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST /events_new-dedicated-01_click/_search | |
{ | |
"sort": [ | |
{ | |
"inserted_date": { | |
"order": "desc", | |
"format": "strict_date_optional_time", | |
"unmapped_type": "boolean" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST /events_new-dedicated-01_click/_search | |
{ | |
"sort": [ | |
{ | |
"inserted_date": { | |
"order": "desc", | |
"format": "strict_date_optional_time", | |
"unmapped_type": "boolean" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const axios = require('axios'); | |
const { Parser } = require('json2csv'); | |
// Função para "achatar" o JSON | |
function flattenObject(obj, prefix = '') { | |
return Object.keys(obj).reduce((acc, k) => { | |
const pre = prefix.length ? `${prefix}_${k}` : k; | |
if (typeof obj[k] === 'object' && obj[k] !== null && !Array.isArray(obj[k])) { | |
Object.assign(acc, flattenObject(obj[k], pre)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* `googleAppScriptAutoBackup.js` creates copy of files | |
* when is opened. This script check if file already exists | |
* so creates the backup file. | |
*/ | |
var prefixBackupName = "MyFileXYZ"; // we're gonna to use as MyFileXYZ- | |
var folderId = "hashFolderIdFoundInURL"; // backup folder: where file to be placed it | |
var principalFileId = "hashFileIdFoundInURL" // principal file that it'll be copied | |
var workDir = DriveApp.getFolderById(folderId); | |
var myGMT = "GMT-3:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference: https://www.youtube.com/watch?v=YDhln3ukH7Y&t=3s | |
function getEvents() { | |
var calId = "yourcalendar@yourbusiness.com"; // this is a Google Calendar Id | |
var startDate = "9/1/2021 12:00 AM" // Month/Day/Year | |
var endDate = "9/13/2021 11:59 PM" // Month/Day/Year | |
var nameOfSheet = "getEventsSheet" // You must have Filename and Sheet names (your tabs inner doc) | |
// spreadsheet | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to harness | |
increasingly | |
affordable | |
advancing | |
rapidly | |
significant costs | |
delays | |
constrain* | |
time | |
spent |
NewerOlder