查看ID为2的这条数据:

使用更新命令:

使用脚本对年龄+5

curl -XPOST http://192.168.6.16:9200/my_new_index/user/2/_update?pretty -d '{"script" : "ctx._source.age += 5"}'

报错:

"reason" : "scripts of type [inline], operation [update] and lang [groovy] are disabled"

解决方法:

在es的conf目录下的 elasticsearch.yml 文件添加如下配置:

 script.inline: on
script.indexed: on

之后重启,再重试该命令

执行成功:

查看

curl -XGET http://192.168.6.16:9200/my_new_index/user/2?pretty

【ELK】elasticsearch中使用脚本报错:scripts of type [inline], operation [update] and lang [groovy] are disabled的更多相关文章

  1. shell脚本报错:-bash: xxx: /bin/bash^M: bad interpreter: No such file or directory

    当我们把文件从windows系统中编辑的文件拷贝到linux系统中,如果我们执行文件会保存如下的错: shell脚本报错:-bash: xxx: /bin/bash^M: bad interprete ...

  2. shell脚本报错:"[: =: unary operator expected"

    shell脚本报错:"[: =: unary operator expected" 在匹配字符串相等时,我用了类似这样的语句: if [ $STATUS == "OK&q ...

  3. 解决执行sql脚本报错:没有足够的内存继续执行程序。

    出现执行sql脚本报错:没有足够的内存继续执行程序.是因为sql脚本过大,大家可能分为多个文件多次执行,这种笨方法可行,不过比较麻烦,大家可以用下面的方式,利用sqlcmd一次就行了:   执行cmd ...

  4. windows 2012执行powershell脚本报错

    使用powershell运行脚本报错:进行数字签名.无法在当前系统上运行该脚本.有关运行脚本和设置执行策略的详细信息 修复方法:powershell "Set-ExecutionPolicy ...

  5. Appium 运行脚本报错InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported for (转)

    现象:Appium运行脚本报错InvalidSelectorException: Message: Locator Strategy 'css selector' is not supported f ...

  6. 解决:在Eclipse中运行monkeyrunner脚本报错: IOError: (2, 'File not found - D:\\workspace\\monkeyrunner_test01 (\u62d2\u7edd\u8bbf\u95ee\u3002)')

    在eclipse中搭建运行monkeyrunner脚本的环境,请见lynnLi的博客monkeyrunner之eclipse中运行monkeyrunner脚本之环境搭建(四) 但在实践中,状况确实层出 ...

  7. Oracle 11g安装GI后,运行roothas.pl脚本报错libcap.so.1找不到

    环境:RHEL6.4 + Oracle 11.2.0.3问题:需求是文件系统迁移到ASM,在安装GI后,运行roothas.pl脚本报错 1.运行root.sh后,按提示运行roothas.pl报错 ...

  8. CRLF line terminators导致shell脚本报错:command not found

    Linux和Windows文本文件的行结束标志不同.在Linux中,文本文件用"/n"表示回车换行,而Windows用"/r/n"表示回车换行.有时候在Wind ...

  9. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

随机推荐

  1. [Linux]F5负载均衡器

    F5负载均衡器是硬件的负载均衡设备 F5配置最简单负载均衡,需要配置的参数有Node(节点).Pool(资源池).和Virtual Server(虚拟服务器),它们的关系是,先配置Node,然后配置V ...

  2. mysql-5..6.23-win64.zip安装及配置

    MySQL是一个小巧玲珑但功能强大的数据库,目前十分流行.但是官网给出的安装包有两种格式,一个是msi格式,一个是zip格式的.很多人下了zip格式的解压发现没有setup.exe,面对一堆文件一头雾 ...

  3. 第七周scrum会议

    本周会议地点依旧 会议照片: 本周内容: 讨论了进行中的难点 我们正在分析图书馆首页的网页结构以及各种跳转的请求以及链接,为爬虫的实现奠定基础. flask框架我们也遇到了很多问题,正在进行官方文档的 ...

  4. 交互器中python中的帮助使用

    C:\Users\ceshi>pythonPython 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:24:40) [MSC v.1500 64 b ...

  5. 12-numpy笔记-莫烦基本操作2

    代码 import numpy as np A = np.arange(3,15) print('-1-') print(A) print('-2-') print(A[3]) A = np.aran ...

  6. continue and break

    #1.continue终止当前循环开始下一次循环count = 0while count < 10: if count == 7: count = count +1 continue print ...

  7. 史上最全NOIP初赛知识点

    CSP-J/S 第一轮知识点选讲 \(NOIP\)(全国青少年信息学奥林匹克竞赛)于2019年取消.取而代之的是由\(CCF\)推出的非专业级软件能力认证,也就是现在的\(CSP-J/S\).作为一名 ...

  8. NOIP 2009 Hankson 的趣味题

    洛谷 P1072 Hankson 的趣味题 洛谷传送门 JDOJ 1648: [NOIP2009]Hankson的趣味题 T2 JDOJ传送门 Description Hanks 博士是BT (Bio ...

  9. 几个简单js,普通写法和高逼格写法比较

    1. 取数组中的数据,并对空值设置默认值: 常规写法: let arr = [0, 1, null, '', 'abc']; let newArr = []; arr.forEach((item, i ...

  10. streamsets 源码构建

    依赖构建工具 git 1.9+ oracle jdk  8 docker 1.10+ maven  3.3.9+ nodejs npm grunt-cli md5sum 预备构建任务 data col ...