How to resolve the Flume Syslog set up error - "Event size larger than specified event size: 2500. Consider increasing the max event size" - flume

I am trying to set up Flume syslog source using org.apache.flume.source.MultiportSyslogTCPSource. Set up and configuration successful but I get the following error while flume generates the event from syslog.
[INFO ] [2019-03-28 13:22:27.217] [[channel=file-channel] - CheckpointBackUpThread] [org.apache.flume.channel.file.EventQueueBackingStoreFile] - Checkpoint backup completed.
[WARN ] [2019-03-28 13:22:31.853] [NioProcessor-2]
[org.apache.flume.source.MultiportSyslogTCPSource] - Event size larger than specified event size: 2500. Consider increasing the max event size.
[INFO ] [2019-03-28 13:22:35.686] [SinkRunner-PollingRunner-DefaultSinkProcessor] [org.apache.flume.sink.LoggerSink] - Event: { headers:{flume.syslog.status=Invalid} body: 31 33 33 62 32 20 74 3C 31 33 34 3E 4D 61 72 20 133b2 t<134>Mar }
Here is my configuration looks like:
#source,channel and sink
testagent.sources = testlog
testagent.channels = file-channel
testagent.sinks = logger-sink
#source
testagent.sources.testlog.type = org.apache.flume.source.MultiportSyslogTCPSource
testagent.sources.testlog.ports = 9002
testagent.sources.testlog.host = 127.0.0.1
#sink
testagent.sinks.logger-sink.type = logger
#channel
testagent.channels.file-channel.type = file
testagent.channels.file-channel.dataDirs = /test/data/01/
testagent.channels.file-channel.checkpointDir = /test/data/01/checkpoint
testagent.channels.file-channel.useDualCheckpoints = true
testagent.channels.file-channel.backupCheckpointDir = /test/data/01/checkpoint-backup
testagent.channels.file-channel.transactionCapacity = 10000
testagent.channels.file-channel.checkpointInterval = 20000
testagent.channels.file-channel.maxFileSize = 1072692224
testagent.channels.file-channel.minimumRequiredSpace = 524288000
testagent.channels.file-channel.capacity = 1000000
testagent.channels.file-channel.keep-alive = 3
testagent.channels.file-channel.checkpointOnClose = true
testagent.sinks.logger-sink.channel = file-channel
testagent.sources.testlog.channels = file-channel
Logs generated out of my test application should successfully be displayed into the flume agent log and events should be generated out of each log statement(line).

Update the size of the event in the configuration as shown below:
testagent.sinks.logger-sink.maxBytesToLog = 256
The default size of the event is 16 bytes.

Related

Awesome WM: Placing tiled clients in specific order on startup

I've installed Awesome WM about a week ago. Since then I've been trying to place terminal clients (bare terminal and vim, vifm, htop) in a specific order on startup. Here is a visual representation of what I'm trying to achieve:
########################
# # htop #
# ###########
# vim # bare #
# ###########
# # vifm #
########################
I've managed to place vim in the right position, but other windows are placed in what seems to be an arbitrary order, which changes with every reboot. Here is the content of my autostart.lua config:
1 local awful = require("awful")
1
2 awful.spawn.single_instance(terminal.."-e xmodmap ~/.Xmodmap; exit")
3 awful.spawn.single_instance("brave-browser", {
4 fullscreen = true,
5 focus = true
6 })
7
8 awful.spawn(terminal.." -e vim", {
9 tag = "edit",
10 placement = awful.placement.left,
11 callback = function(c) awful.client.setmaster(c) end})
12 awful.spawn(terminal.." -e htop", {
13 tag = "edit",
14 height = 80,
15 placement = awful.placement.top_right})
16 awful.spawn(terminal, {
17 tag = "edit",
18 placement = awful.placement.right})
19 awful.spawn(terminal.." -e vifm", {
20 tag = "edit",
21 placement = awful.placement.bottom_right})
22
23 awful.spawn(terminal.." -e neomutt", {
24 tag = "communication",
25 fullscreen = true })
26
27 awful.spawn("Spotify", { tag = "read" })
The layout of the tag with which I have problem is "tile". I'm on Awesome v4.3. What client property should I add to get the desired behavior?
To get clients been spawned in the desired positions on startup callback option should be used. Here is a chunk of my autostart.lua file related to the issue:
1 local awful = require("awful")
1
2 local function spawn_vifm ()
3 awful.spawn(terminal.." -e vifm", {
4 tag = "edit",
5 placement = awful.placement.bottom_right
6 })
7 end
8
9 local function spawn_term ()
10 awful.spawn(terminal, {
11 tag = "edit",
12 placement = awful.placement.right,
13 callback = function(c) spawn_vifm() end
14 })
15 end
16
17 local function spawn_htop ()
18 awful.spawn(terminal.." -e htop", {
19 tag = "edit",
20 placement = awful.placement.top_right,
21 callback = function(c) spawn_term() end
22 })
23 end
.......
38 awful.spawn(terminal.." -e vim", {
39 tag = "edit",
40 placement = awful.placement.left,
41 callback = function(c)
42 awful.client.setmaster(c)
43 store_active_client(awful.tag.find_by_name(awful.screen.focused(), "edit"), c)
44 spawn_htop()
45 end
46 })
Spawning the next client in the callback function of the previous one ensures, that the placement property will be preserved for both of them.
I don't know what you mean by this: "The layout of the tag with which I have problem is tiled left." I assume you mean that your terminals aren't tiling properly? I've used AwesomeWM for about a week a few years ago, but realized quickly it needs a lot of tinkering to get exactly how you want it. What's happening to you is exactly what I was running into.
Found it easier just to use LXDE and Devilspie2. You can Lua script windows to undecorate & maximise, jump to other desktops or whatever you want, fairly easily. This might help get you where you're going, but it's hard to say, without clarification on your question.
local screenwidth = awful.screen.geometry.width
local screenheight = awful.screen.geometry.height
local halfwidth = math.floor( screenwidth /2 )
local thirdheight = math.floor( screenheight /3 )
awful .spawn( terminal .." -e vim", {
tag = "edit",
width = halfwidth,
height = screenheight,
placement = awful .placement .left,
callback = function(c) awful .client .setmaster(c) end } )
awful .spawn( terminal.." -e htop", {
tag = "edit",
width = halfwidth,
height = thirdheight,
placement = awful .placement .top_right } )
awful .spawn( terminal, { -- bare
tag = "edit",
width = halfwidth,
height = thirdheight,
placement = awful .placement .right } )
awful .spawn( terminal .." -e vifm", {
tag = "edit",
width = halfwidth,
height = thirdheight,
placement = awful .placement .bottom_right } )
Also, I'd point out that Conky might be a viable solution, if you're just looking to view terminal output on your desktop, while scripting in Lua.

tensorflow for poets: “The name 'import/Mul' refers to an Operation not in the graph.”

İ try to use tensorflow image retraining.
https://www.tensorflow.org/tutorials/image_retraining
train like that and it is OK:
D:\dev\Anaconda\python D:/dev/detect_objects/tensorflow-master/tensorflow/examples/image_retraining/retrain.py --image_dir D:/dev/detect_objects/flower_photos --bottleneck_dir D:/dev/detect_objects/tensorflow-master/retrain/bottleneck --architecture mobilenet_0.25_128 --output_graph D:/dev/detect_objects/tensorflow-master/retrain/output_graph/output.pb --output_labels D:/dev/detect_objects/tensorflow-master/retrain/output_labels/labels.txt --saved_model_dir D:/dev/detect_objects/tensorflow-master/retrain/saved_model_dir --how_many_training_steps 100
When predict new image like:
D:\dev\Anaconda\python D:/dev/detect_objects/tensorflow-master/tensorflow/examples/label_image/label_image.py --graph=D:/dev/detect_objects/tensorflow-master/retrain/output_graph/output.pb --labels=D:/dev/detect_objects/tensorflow-master/retrain/output_labels/labels.txt --image=D:/dev/detect_objects/flower_photos/daisy/21652746_cc379e0eea_m.jpg
It gives error
KeyError: "The name 'import/Mul' refers to an Operation not in the graph."
label_image.py content:
input_height = 299
input_width = 299
input_mean = 0
input_std = 255
#input_layer = "input"
#output_layer = "InceptionV3/Predictions/Reshape_1"
input_layer = "Mul"
output_layer = "final_result"
What is the problem here?
Change this:
input_height = 299
input_width = 299
input_mean = 0
input_std = 255
#input_layer = "input"
#output_layer = "InceptionV3/Predictions/Reshape_1"
input_layer = "Mul"
output_layer = "final_result"
to this:
input_height = 128
input_width = 128
input_mean = 0
input_std = 128
input_layer = "input"
output_layer = "final_result"
If there is no node in the graph called "import/Mul" and we don't know
what the graph is or how it was produced, there's little chance that
anyone will be able to guess the right answer.
You might try printing the list of operations of your graph using graph.get_operations() and attempting to locate an appropriate-sounding node (try the first one that is printed)

Recursive daily forecast

I am doing a recursive one-step-ahead daily forecast with different time series models for 2010. For example:
set.seed(1096)
Datum=seq(as.Date("2008/1/1"), as.Date("2010/12/31"), "days")
r=rnorm(1096)
y=xts(r,order.by=as.Date(Datum))
List.y=vector(mode = "list", length = 365L)
for (i in 1:365) {
window.y <- window(y[,1], end = as.Date("2009-12-30") + i)
fit.y <- arima(window.y, order=c(5,0,0))
List.y[[i]] <- forecast(fit.y , h = 1)
}
the list looks like this:
List.y
[[1]]
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
732 -0.0506346 -1.333437 1.232168 -2.012511 1.911242
[[2]]
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
733 0.03905936 -1.242889 1.321008 -1.921511 1.99963
....
[[365]]
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
1096 0.09242849 -1.1794 1.364257 -1.852665 2.037522
And now I want to extract only the forecast value for each period [1]-[365], so I can work with the forecast data. However, I am not sure how to do this.
I tried
sa=sapply(List.y[1:365], `[`, 4)
but then I only get this:
$mean
Time Series:
Start = 732
End = 732
Frequency = 1
[1] -0.0506346
$mean
Time Series:
Start = 733
End = 733
Frequency = 1
[1] 0.03905936
...
$mean
Time Series:
Start = 1096
End = 1096
Frequency = 1
[1] 0.09242849
but I want all 365 [1] values in a numeric vector or something, so I can work with the data.
Just use this: sa2=as.numeric(sa). sa2 will be a numeric vector of forecasted means.

Scintilla fold margin icons

The following code I use sets a Scintilla window for folding:
local SCI_STYLECLEARALL = 2050
local SCI_SETMARGINMASKN = 2244
local SCI_SETMARGINSENSITIVEN = 2246
local SCI_STYLESETFORE = 2051
local SCI_MARKERDEFINE = 2040
local SC_MARKNUM_FOLDEROPEN = 31
local SC_MARK_BOXMINUS = 14
local SC_MARKNUM_FOLDER = 30
local SC_MARK_BOXPLUS = 12
local SC_MARKNUM_FOLDERSUB = 29
local SC_MARK_VLINE = 9
local SC_MARKNUM_FOLDERTAIL = 28
local SC_MARK_LCORNERCURVE = 16
local SCI_MARKERSETFORE = 2041
local SCI_MARKERSETBACK = 2042
local SCI_SETFOLDMARGINCOLOUR = 2290
local SCI_USEPOPUP = 2371
local SCI_SETMARGINWIDTHN = 2242
local SCI_STYLESETSIZE = 2055
Scintilla.SendMessage(Ctrl,SCI_STYLECLEARALL,0,0)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINWIDTHN,1,0)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINSENSITIVEN,2,1)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINMASKN,2,-33554432)
Scintilla.SendMessage(Ctrl,SCI_STYLESETFORE,32,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDEROPEN,SC_MARK_BOXMINUS)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDER,SC_MARK_BOXPLUS)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDERSUB,SC_MARK_VLINE)
Scintilla.SendMessage(Ctrl,SCI_MARKERDEFINE,SC_MARKNUM_FOLDERTAIL,SC_MARK_LCORNERCURVE)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETFORE,SC_MARKNUM_FOLDER,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDER,16777215)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETFORE,SC_MARKNUM_FOLDEROPEN,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDEROPEN,16777215)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDERSUB,12632256)
Scintilla.SendMessage(Ctrl,SCI_MARKERSETBACK,SC_MARKNUM_FOLDERTAIL,12632256)
Scintilla.SendMessage(Ctrl,SCI_SETMARGINWIDTHN,2,20)
Scintilla.SendMessage(Ctrl,SCI_USEPOPUP,0,0)
Scintilla.SendMessage(Ctrl,SCI_SETFOLDMARGINCOLOUR,1,16777215)
Scintilla.SendMessage(Ctrl,SCI_STYLESETSIZE,32,10)
but for whatever reason the default circle icon for the fold open/close does not get overwritten by the new value so the circle shows below the new selection:
have tried SCI_MARKERDELETEALL and SCI_MARKERDELETE to try to remove the default icon before applying the new one but it has no effect, how do I get rid of the offending circle?
The square is the default Scintilla image and according to the docs it should not look like that (Box +, Box -):
You need to set all folder markers for them to be drawn properly.

JQuery UI accordion is slow in IE 8

I have a web application screen with number of dynamically created JQuery UI accordions. I am looping through the incoming JSON string and dynamically create the accordions as follows.
for (i in json.panels) {
var accordionName = json.panels[i].panelName;
var isExpanded = json.panels[i].expand;
var activeProperty = (isExpanded) ? 0 : false;
var accordElemId = "accordion_"+i;
var accordDiv = '<div id="' + accordElemId + '"></div>';
var accordion = $("#"+accordElemId );
var startTime = new Date().getTime();
accordion.accordion({
collapsible: true,
heightStyle: "content",
active: activeProperty,
animated : false
});
var endTime = new Date().getTime();
console.log("Time for "+accordionName+"="+(endTime - startTime));
}
Then i compared the time to create each accordion in IE8 and IE10
in IE8 i found its really slow and when i navigate through pages the performance is continuously degrade.
please have a look at following figures, time is in milliseconds.
1)
LOG: ----------------------------start -------------------------------------
LOG: Time for Patient Address = 16
LOG: Time for Current Legal Status = 32
LOG: Time for Alerts and Risk Factors = 0
LOG: Time for Current Wards/Programs = 16
LOG: Time for Open Orders = 0
LOG: Time for RAI-MH Form = 0
LOG: Time for RAI = 16
LOG: Time for OCAN-C = 31
LOG: Time for LD = 0
LOG: --- Diff create ajaxURL = 0
LOG: ----------------------------end -------------------------------------
2)
LOG: ----------------------------start -------------------------------------
LOG: Time for Patient Address = 16
LOG: Time for Current Legal Status = 47
LOG: Time for Alerts and Risk Factors = 32
LOG: Time for Current Wards/Programs = 16
LOG: Time for Open Orders = 15
LOG: Time for RAI-MH Form = 110
LOG: Time for RAI = 140
LOG: Time for OCAN-C = 141
LOG: Time for LD = 31
LOG: --- Diff create ajaxURL = 0
LOG: ----------------------------end -------------------------------------
3)
LOG: ----------------------------start -------------------------------------
LOG: Time for Patient Address = 62
LOG: Time for Current Legal Status = 485
LOG: Time for Alerts and Risk Factors = 15
LOG: Time for Current Wards/Programs = 219
LOG: Time for Open Orders = 391
LOG: Time for RAI-MH Form = 62
LOG: Time for RAI = 250
LOG: Time for OCAN-C = 391
LOG: Time for LD = 110
LOG: --- Diff create ajaxURL = 0
LOG: ----------------------------end -------------------------------------
Then i tried IE 10 and it super fast and it is consistent with the performance
----------------------------start -------------------------------------
Time for Patient Address = 7
Time for Current Legal Status = 5
Time for Alerts and Risk Factors = 5
Time for Current Wards/Programs = 6
Time for Open Orders = 6
Time for RAI-MH Form = 6
Time for RAI = 4
Time for OCAN-C = 4
Time for LD = 4
--- Diff create ajaxURL = 0
----------------------------end ------------------------------------
Do you guys have any idea about this? appreciate you help
Thanks,
Keth

Resources