中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

重慶網(wǎng)領(lǐng)網(wǎng)站建設(shè)公司百度快照客服人工電話

重慶網(wǎng)領(lǐng)網(wǎng)站建設(shè)公司,百度快照客服人工電話,如何做網(wǎng)站數(shù)據(jù)庫備份,網(wǎng)站開發(fā)程序都有什么前言 由于mysql鏈接超時波動,導(dǎo)致數(shù)據(jù)缺失,需要根據(jù)日志填補數(shù)據(jù) 流程 獲取確實數(shù)據(jù)的訂單列表 搜索日志,獲取請求日志 根據(jù)請求日志拼裝sql 打印sql供修復(fù)數(shù)據(jù) 代碼 因為我們?nèi)罩敬蛴〉挠袉栴},所以這里用字符串截取獲取入…

前言

由于mysql鏈接超時波動,導(dǎo)致數(shù)據(jù)缺失,需要根據(jù)日志填補數(shù)據(jù)

流程

獲取確實數(shù)據(jù)的訂單列表

搜索日志,獲取請求日志

根據(jù)請求日志拼裝sql

打印sql供修復(fù)數(shù)據(jù)

代碼

因為我們?nèi)罩敬蛴〉挠袉栴},所以這里用字符串截取獲取入?yún)?。如果日志打印的是?biāo)準(zhǔn)json,直接搞json即可

from elasticsearch import Elasticsearch
import jsonclass MyUtils:passdef getValue(fullStr, beginStr, endStr):start = fullStr.find(beginStr) + len(beginStr)end = fullStr.find(endStr)value = fullStr[start:end]return valuedef setValue(orderInfoExt, columnName, fullStr, beginStr, endStr):value = MyUtils.getValue(fullStr, beginStr, endStr)if value != 'null':orderInfoExt[columnName] = valuees = Elasticsearch(hosts="http://xxx:9200/", http_auth=('xxx', 'xxx'))
scroll_id = None
fileName = "create-order-info" + ".txt"
orderIdList = [74xxxx574,74xxxx822]
orderExtInfoList = []for orderId in orderIdList:query_json = {"_source": ["message", "logger_name", "@timestamp"],"query": {"bool": {"filter":[{"bool":{"filter":[{"multi_match":{"lenient": True,"query": "order/v1/createOrder","type": "phrase"}},{"multi_match":{"lenient": True,"query": orderId,"type": "phrase"}}]}},{"range":{"@timestamp":{"format": "strict_date_optional_time","gte": "2024-11-01T00:00:00.000Z","lte": "2024-11-02T10:00:00.000Z"}}}],"must":[],"must_not":[],"should":[]}}}query = es.search(index='xxxx-pro*', body=query_json, scroll='25m', size=5000,request_timeout=2000000)for k in query['hits']['hits']:timestr = k['_source']['@timestamp']request = k['_source']['message']orderInfoExt = {}#beancopy的字段MyUtils.setValue(orderInfoExt, 'user_device_mac', request, "userDeviceMac=", ", userDeviceImei")MyUtils.setValue(orderInfoExt, 'user_device_imei', request, "userDeviceImei=", ", userDeviceImsi")#特殊的字段MyUtils.setValue(orderInfoExt, 'order_id', request, "orderId=", ", oid")MyUtils.setValue(orderInfoExt, 'user_order_ip', request, "userIpAddr=", ", userPort")#print(orderInfoExt)orderExtInfoList.append(orderInfoExt)
# 假設(shè)表名為 orders
table_name = 'order_info_ext'
for orderInfoExt in orderExtInfoList:# 提取列名columns = ', '.join(orderInfoExt.keys())# 提取值,并處理為適當(dāng)?shù)母袷絭alues = []for key, value in orderInfoExt.items():if value == 'null':values.append('NULL')elif isinstance(value, (int, float)):values.append(str(value))elif isinstance(value, str):values.append("'"+value+"'")else:values.append('NULL')# 構(gòu)建 INSERT 語句sql = f"INSERT INTO {table_name} ({columns}) VALUES ({', '.join(values)});"print(sql)

http://www.risenshineclean.com/news/35825.html

相關(guān)文章:

  • 內(nèi)容導(dǎo)購網(wǎng)站模板網(wǎng)頁設(shè)計個人主頁模板
  • 網(wǎng)站建設(shè)策劃實訓(xùn)總結(jié)谷歌優(yōu)化推廣
  • 專業(yè)網(wǎng)站建設(shè)哪里好葫島百度seo
  • 企業(yè)網(wǎng)站 留言板站長之家seo查找
  • 織夢網(wǎng)站如何做seo班級優(yōu)化大師免費下載
  • 廣州網(wǎng)站建設(shè)廣州網(wǎng)絡(luò)推廣公司如何建立一個網(wǎng)站
  • ftp網(wǎng)站劫持微博推廣怎么做
  • 網(wǎng)站建設(shè)違約怎么優(yōu)化網(wǎng)站排名才能起來
  • 公司網(wǎng)站建站哪個系統(tǒng)好用網(wǎng)站建設(shè)seo優(yōu)化培訓(xùn)
  • flashcs6網(wǎng)站建設(shè)成品網(wǎng)站貨源1
  • 培訓(xùn)公司網(wǎng)站建設(shè)圖片外鏈生成
  • 個人博客網(wǎng)站總結(jié)漯河seo推廣
  • 簡單大氣網(wǎng)站欣賞數(shù)據(jù)推廣公司
  • 福州市人民政府網(wǎng)免費seo網(wǎng)站推薦一下
  • 有網(wǎng)站地圖的網(wǎng)站怎樣淘寶seo排名優(yōu)化
  • 做卡通的素材網(wǎng)站jsurl轉(zhuǎn)碼
  • 公司做網(wǎng)站找誰公司做網(wǎng)站找誰整合營銷傳播案例分析
  • 工商局網(wǎng)站怎么做增項網(wǎng)絡(luò)推廣都需要做什么
  • 兩學(xué)一做 網(wǎng)站源碼app注冊推廣團隊
  • 信譽比較好的商家可做網(wǎng)站蘇州seo優(yōu)化
  • 萬象園網(wǎng)站建設(shè)與開發(fā)阿里云com域名注冊
  • 武漢公司網(wǎng)站建設(shè)高端網(wǎng)站建設(shè)哪家便宜
  • 重慶造價信息網(wǎng)官網(wǎng)首頁長沙seo外包
  • 搜搜提交網(wǎng)站入口長沙網(wǎng)站seo報價
  • 游戲推廣網(wǎng)站怎么做南京網(wǎng)絡(luò)營銷服務(wù)
  • 做英文網(wǎng)站 賺美元網(wǎng)絡(luò)推廣費計入什么科目
  • 榆林做網(wǎng)站多少錢網(wǎng)絡(luò)游戲推廣怎么做
  • 網(wǎng)絡(luò)公司 網(wǎng)站建設(shè) 小程序關(guān)鍵詞代做排名推廣
  • 自己做網(wǎng)站跟域名怎樣做房地產(chǎn)估價師考試
  • 免費網(wǎng)站注冊永久2345網(wǎng)址導(dǎo)航電腦版